Multi-field field map with child lookup

I have a results mapping where I need to combine values that have multiple locations 1 in the parent object and multiple in the child objects. For simplicity sake the object looks like this:
{
  "id": "294726",  
  "tags": "black, orange",
  "child_items": [
    {
      "id": "295544",      
      "tags": "red, blue"
    },
    {
      "id": "295545",      
      "tags": "yellow, green"
    },
    {
      "id": "295546",      
      "tags": "tall, pink"
    }
  ]
}

 

I tried {{tags}}{{child_items[*].tags}} but that is throwing an error. How can I get the resultant field called tags to have "black, orange, red, blue, yellow, green, tall, pink"?

0

Comments

2 comments
Date Votes
  • Hi Corey Hunt

    We can achieve this use case using a script in postresponsehook. Add a script that traverses to all objects and you can push those values into an array or to another JSON object.

    Thanks!

    1
  • I was afraid that was the case. Thanks, I'll give that a try.

    0

Please sign in to leave a comment.

 

Didn't find what you were looking for?

New post