cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Example how to parse a JSON file and use where and pluck to extract specific data

gfranco
Deputy Chef I
Deputy Chef I

I am following along on the training in Automation Pro III, I completed the part of the CSV file and at the end, you can logger the data in the Workato app.

I want to follow the same scenario but using a JSON provided, but I do not have an idea after configuring the JSON document what else I should do.

 
 

1. Trigger scheduler

2. Parse Json document

use where('country': "FRANCE).pluck('email')

3. Log message to job report

 

I appreciate your help.

1 REPLY 1

shivakumara
Executive Chef II
Executive Chef II

Hi @gfranco ,
Hereโ€™s my understanding based on the given requirements for the main logic:

  1. Parse the JSON data and filter it based on the Country field, then log the filtered data.

Solution:

  1. Pass the required data as-is in the Parse JSON step (both sample and actual documents).
  2. Use a Formula to extract the filtered data (e.g., where('country': "FRANCE").pluck('email')). 
     Double quote should there for [Example: "Country",  "FRANCE", "email"]

Parse JSON: This component is used to extract incoming data based on the provided sample document.
Thus, it's best to apply the Formula after the extraction step 2 in your case.

JSON parser_1.PNGJson parser_2.PNG

Thanks and Regards,
Shivakumara K A