Adrian_Santamaria | 2019-05-20 14:57:28 UTC | #1
Hello
We have tried what this link says to get multiple results with Data Actions, but we are unable to use the retrieved values in Architect.
This is what we are getting with the Action:
[ { "cases.attributes.type": [ "Case", "Case", "Case" ], "cases.CaseNumber": [ "00001230", "00001229", "00001228" ], "cases.attributes.url": [ "...", "...", "..." ], "cases.CreatedDate": [ "2019-05-20T12:01:24.000+0000", "2019-05-20T12:01:05.000+0000", "2019-05-20T12:00:52.000+0000" ], "cases.Subject": [ "3", "2", "1" ] } ]
And our output contract is:
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "Get all the cases objects", "type": "object", "properties": { "cases.Subject": { "description": "SJ", "title": "SJ", "type": "array" }, "cases.CaseNumber": { "description": "CN", "title": "CN", "type": "array" }, "cases.CreatedDate": { "description": "CD", "title": "CD", "type": "array" } } }
In Architect we store the output properties in Task variables, but when we try to use them, the flow fails, reproduces the fail message and disconnects.
For example, we store cases.Subject in a variable called Task.Subj, but when we try to use Task.Subj[0], the flows fails.
Could you tell us how can we use that arrays?
Jason_Mathison | 2019-05-20 15:57:49 UTC | #2
Hi Adrian_Santamaria,
It looks like you are trying to flatten your output contract by hand. Instead you should create your output contract based on the output of the web service. The Data Action service will take care of flattening both the output and the output contract.
If you have any trouble creating the output schema you can google for "json schema generator". That will return multiple sites that can help you create a JSON schema (although you often have to delete some of the extras that they include in the generated schema).
--Jason
Adrian_Santamaria | 2019-05-21 08:08:32 UTC | #3
Thank you Jason! It worked :slight_smile:
system | 2019-06-21 08:08:35 UTC | #4
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: 5196