Thanks a lot, I am able to access the data action ouput as string and parse them using the JSON functions available in the architect.
Computer Generated Solutions, Inc.
Original Message:
Sent: 08-04-2024 20:40
From: Anton Vroon
Subject: Read the output from json response to output variables in Data action contract.
If there is any chance of your backend responding with an array of objects instead of an array of array's that will make everything so much easier for you.
Otherwise. To check the value in architect, I usually write it as participant data to see the raw output. But again if using an array of array architect is not going to like that. There is not data type for that. Which is why we then suggest you consider using the raw json and then use a Json data type in Genesys, which is itself a learning curve if you are not use to the syntax.
So here is an example, where I map an output called raw_json to the full rawResults, but you could do it mapped to the row array instead if you want.

Then in Architect you are going take the string output from the data action and assign it to a Json data type:

to something like:

Maybe with a check before hand to ensure it is valid json first.
Then you can use the elements within with standard JSON parsing, there is also some function to check in the expression help section

It is entirely up to you to ensure the naming and data structure is right though, there is no inbuilt checker.
Here are some of the functions that are available for json objects in architect:

------------------------------
Anton Vroon
Original Message:
Sent: 08-02-2024 07:23
From: Karthik Ageer
Subject: Read the output from json response to output variables in Data action contract.
I have tried to map rows to Array like in the attached screen shot, I get the error "there was an error updating Getthe Orderdetails".Can you please help me. Is there a devcast tutorial or example flow that i can refer please?
------------------------------
Karthik Ageer
Computer Generated Solutions, Inc.
Original Message:
Sent: 08-01-2024 09:44
From: Jim Crespino
Subject: Read the output from json response to output variables in Data action contract.
One thing to consider doing here, when you have complex, hierarchical data being returned by a Data Action, is to define "Rows" as an array in the Output Contract so that you return the entire JSON array to Architect. You can then use all the newer JSON parsing functions in Architect to extract data from the JSON. Working with the JSON parsing functions is much easier, in my opinion, then trying to use transforms and output contracts.
------------------------------
Jim Crespino
Senior Director, Developer Evangelism
Genesys
https://developer.genesys.com
Original Message:
Sent: 08-01-2024 07:22
From: Karthik Ageer
Subject: Read the output from json response to output variables in Data action contract.
1) if i select the flatten output option i get the error " cannot flatten schemas with nested arrays", Attached screen shot of the error.
2) if i uncheck the flatten output option i am able to parse the output to variable in data action, attached screen shot.
3) attached the screen shots of response from google bigquery and the output parsed in data action.
Please help me in how can i use this output from dataaction in architect, the contents are basically the customeremail, orderID, orderedDate, status, paymentmethod, trackingID and customername.
------------------------------
Karthik Ageer
Computer Generated Solutions, Inc.
Original Message:
Sent: 07-31-2024 17:33
From: Anton Vroon
Subject: Read the output from json response to output variables in Data action contract.
So once your output contracts is working switch it back to flatten to see what it will look like in Architect.
I don't have any similar datasets on hand to replicate my end sorry, so would help seeing your output contract and example of the assigned outputs in the test data action.
But what you have is an array of arrays, where all the fields in that nested array have all the same name "v", which I feel is going to make things difficult.
But if you can provide some screenshots, of the output contract and what you get in those outputs when you run the data action in test, it will help.
But in general you access lists/arrays in Genesys architect with either GetAt() function or through standard [] eg flow.myArry[0]

------------------------------
Anton Vroon
Original Message:
Sent: 07-31-2024 12:19
From: Karthik Ageer
Subject: Read the output from json response to output variables in Data action contract.
I have published the data action and noticed that the output for the data action is showing as rows.f.v. with in the architect how can i verify/view the value assigned to the output ?
------------------------------
Karthik Ageer
Computer Generated Solutions, Inc.
Original Message:
Sent: 07-30-2024 18:38
From: Anton Vroon
Subject: Read the output from json response to output variables in Data action contract.
Hi Karthik
That looks like the flattened results, when testing the data action untick flatten results, the base raw results is what you want to build your output contract around not the flattened results.
------------------------------
Anton Vroon
Original Message:
Sent: 07-30-2024 11:21
From: Karthik Ageer
Subject: Read the output from json response to output variables in Data action contract.
Hi All,
We have a table in Google BigQuery that contains a list of orders. I am working on fetching the list of orders and their attributes for a particular customer using Data action. Since one customer can have multiple orders, the API will return multiple rows.
I am able to make the API request using a Data Action and retrieve the list of order IDs for a particular customer. However, I am unable to parse the JSON response and assigning it to an output variable/contract.
Can you please guide me on this.
{
"rows.f.v": [
[
"kageer@cgsinc.com",
"112335",
"2024-04-15",
"Pending",
"Visa Card ending 1234",
"2S100023546785",
"Rodan Fields"
],
[
"kageer@cgsinc.com",
"657845",
"2024-03-15",
"Shipped",
"Visa Card ending 1234",
"2S100023546785",
"Rodan Fields"
],
[
"kageer@cgsinc.com",
"566542",
"2024-03-25",
"Shipped",
"Visa Card ending 1234",
"2S100023546785",
"Rodan Fields"
]
]
}
#API/Integrations
#Implementation
------------------------------
Karthik Ageer
Computer Generated Solutions, Inc.
------------------------------