square_eyes | 2020-10-06 20:58:50 UTC | #1
I have a working data action. I want to use a KVP in the json response in a Decision/Switch block. I can't for the life of me (in docs or in practice) figure out how to access the data action json.
Example...
Data action response {"foo" : "bar"}
Switch: path of first True
dataAction.foo == "bar"
etc
The doco says it's done in a Decision/Switch. But not how it's done.
square_eyes | 2020-10-06 21:08:59 UTC | #2
Found something here: https://help.mypurecloud.com/articles/call-data-action/
It references Success Outputs
Select an existing variable or enter a new variable to assign the data values returned by the integration data action.
Note: Click the arrow next to Success Outputs and expand or collapse the list of variables.
But I have nothing there after inputs...
Here is my data action tested...
square_eyes | 2020-10-06 23:50:52 UTC | #3
Note I don't really want to transpose the output. Just access the KVP in my test raw json.
Jason_Mathison | 2020-10-07 11:42:43 UTC | #4
You are going to need to create a new action that includes "URL" in the output contract as a string variable. At that point it should show up as a variable you can bind in architect. Note, you can copy your existing action instead of having to completely start over.
If that isn't enough to get you going in the right direction please post an export of your action, redacting any sensitive parts.
--Jason
square_eyes | 2020-10-09 02:17:47 UTC | #5
Thanks, that seemed to work. I had to fiddle around with the transform as well, reluctantly. I think when the user has control over the remote host output format, it would be better to allow disabling of the transform step. Is that even possible? Seems like overkill to have in/out contracts as well as transform if it's not needed. Might just be me and my inexperience. I was just trying to follow the guides and used snippets of examples. But at least it's working now.
Jason_Mathison | 2020-10-09 10:48:00 UTC | #6
Hi square_eyes,
It is pretty common to have the output contract match what the remote endpoint is returning, eliminating the need for any transform configuration. If you want to post a redacted example of a response from the remote endpoint and an export of your data action (also redacted as needed) we can see if you could change your output contract to get rid of the transform.
--Jason
system | 2020-11-09 10:48:03 UTC | #7
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 8988