Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
sushantk19
Creator
Creator

Merging of the paths of the Jason Objects

Hello Team,

I have to read Json Output from URL. I am able to do that.

Then I have to parse the json data to extract the different fields and its value. The issue is that these fields are at different path. SOme of them at the root path and others are embedded within other objects. for eg:

  "total_items": 12,

  "page_count": 1,

  "items": [

    {

      "landing_id": ",

      "token": "",

      "response_id": "",

      "landed_at": "2021-08-23T10:28:29Z",

      "submitted_at": "2021-08-23T10:28:31Z",

      "metadata": {

        "user_agent": "",

        "platform": "other",

        "referer": "",

        "network_id": "6ad90d4091",

        "browser": "default"

      },

      "hidden": {

        "cid": "xxxxx",

        "language": "xxxxx",

        "sku": "xxxxx"

my output fields in database are are:

response_id

landed_at

submitted_at

network_id

cid": "xxxxx",

language": "xxxxx",

sku": "xxxxx"

as you see the 1st 3 fields are from root path and others are from embedded objects in root path. How to merge/get this output in single textractJasonfields component? I am able to extract the values from the above fields independently, but unable to merge them into a single output. Any advice will be helpful here.

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Using the JSON you have posted here I have built an example of what you would need. My tExtractJsonFields component is configured like below....

0695b00000HtszQAAR.png 

The Loop Jsonpath query is set to "$.items[*]".

 

For the paths to the fields you simply supply the path after the "items" array. So, for example, "cid" is just "hidden.cid" .

View solution in original post

2 Replies
Anonymous
Not applicable

Using the JSON you have posted here I have built an example of what you would need. My tExtractJsonFields component is configured like below....

0695b00000HtszQAAR.png 

The Loop Jsonpath query is set to "$.items[*]".

 

For the paths to the fields you simply supply the path after the "items" array. So, for example, "cid" is just "hidden.cid" .

sushantk19
Creator
Creator
Author

@rhall: Excellent! it works perfectly fine for my requirement. Thanks a lot again 🙂