Payload in script action not working

Praveen75
Tera Contributor

Hi Guys, I have an issue where giving payload in script action is not working. Please provide correction to the below code and help. Thanks.

input: considered as string.

Payload: {

                "ID": "1234".

                 "Name": "XYZ".

                  "Location" : {

                                      "Region": "India",

                                       "Pin" : "040",

                                        }

                        }    

how to pass dynamic values to "Location" from inputs ? Please help.

 

 

 

1 REPLY 1

Tony Chatfield1
Kilo Patron

Hi, unfortunately your post doesn't appear to include details of the source payload, which makes identifying your issue difficult. The identifier 'Locations' seems to imply multiple records (as opposed to single 'location'), which could possibly mean 'locations' is an array? If yes, you would need to loop through the array and map each element eg input.locations[i].locName