We have already completed the SAP integration. The SAP Endpoints are also accessible from Genesys.
Ask : We are looking to run two Data Actions ( Acquire a Json object from one Data action of method type GET and pass it to the next Data Action of type POST, both Data Action will be called from Architect Flow ).
Detailed Explanation
Step 1) Get Request :
When we perform a Get, we receive a JSON response like the below one
**Sample Response**
{
"d": {
"results": [
{
"__metadata": {
"id": "Something",
"uri": "Something",
"type": "Something"
},
"DocumentNumber": "SomeDocumentNumber",
"ProfileId": "",
"RepetitionItem": "000",
"Item": "0001",
"SubItem": "000",
"BusinessPartner": "SomeBPNumber",
"ContractAccountNumber": "SomeCANumber",
"Text": "",
"Currency": "CAD",
"NetDate": "/Date(1673481600000)/",
"Amount": "307.00",
"NetDateString": "2023-01-12T00:00:00"
},
{
"__metadata": {
"id": "Something",
"uri": "Something",
"type": "Something"
},
"DocumentNumber": "SomeDocumentNumber",
"ProfileId": "",
"RepetitionItem": "000",
"Item": "0003",
"SubItem": "000",
"BusinessPartner": "SomeBPNumber",
"ContractAccountNumber": "SomeCANumber",
"Text": "",
"Currency": "CAD",
"NetDate": "/Date(1673481600000)/",
"Amount": "1330.21",
"NetDateString": "2023-01-12T00:00:00"
}
]
}
}
We are interested in retrieving the JSON under "d.results", we need to store the Array
The Output will be an Array of JSON Object.
Note : The size of the Results ( total number of Objects returned can go on unto 400 items )
There is no fixed Size for Results.
Help us to frame an Output contract, so that the Results of any size can be stored in ( Architect Flow ).
Sample Ouput we need to be stored in Architect.
Question 1: What Should be output Contract in Data Action ?
Question 2: What Data Type needs to used in Architect for storing the Output
Step 2: POST Request :
Request Body Template
{
"ProfileId" : "",
"ContractAccountNumber" : "SomeCANumber",
"BusinessPartner" : "SomeBPNumber",
"StartDate" : "2023-01-17T00:00:00",
"DocumentDate" : null,
"PostingDate" : null,
"DocumentType" : "IP",
"InstallmentAmount" : "0.00",
"InstallmentPlanType" : "0019 ",
"ChargeAmount" : "0.00",
"RemainingAmount" : " ",
"Simulation" : true,
"Category" : "19 ",
"Term" : "6",
"Cycle" : "MO",
"OpenItems" : [
// Here the Output obtained in Step 1 Should be used
{
"__metadata": {
"id": "Something",
"uri": "Something",
"type": "Something"
},
"DocumentNumber": "SomeDocumentNumber",
"ProfileId": "",
"RepetitionItem": "000",
"Item": "0001",
"SubItem": "000",
"BusinessPartner": "SomeBPNumber",
"ContractAccountNumber": "SomeCANumber",
"Text": "",
"Currency": "CAD",
"NetDate": "/Date(1673481600000)/",
"Amount": "307.00",
"NetDateString": "2023-01-12T00:00:00"
},
{
"__metadata": {
"id": "Something",
"uri": "Something",
"type": "Something"
},
"DocumentNumber": "SomeDocumentNumber",
"ProfileId": "",
"RepetitionItem": "000",
"Item": "0003",
"SubItem": "000",
"BusinessPartner": "SomeBPNumber",
"ContractAccountNumber": "SomeCANumber",
"Text": "",
"Currency": "CAD",
"NetDate": "/Date(1673481600000)/",
"Amount": "1330.21",
"NetDateString": "2023-01-12T00:00:00"
}
] }
Question 3 :
Is there is a way to pass the JSON object in the POST as an Input parameter.
The Input Parameter needs to be sent from Architect Flow.
I get the following error, when trying to use the Input type as Object.
"Failed Validation of contract.input.inputSchema as a simple properties schema.
Must be an Object with properties and no sub-objects.
JSON failed schema validation for the following reasons: Schema: # @/properties/properties/patternProperties/^[a-zA-Z][a-zA-Z0-9_-]*$/properties/type.
Error location: /properties/Results/type. instance value ("object") not found in enum (possible values: ["boolean","integer","null","number","string"])"