Hi,
I was stuck i am doing an POC, i want to display the api response to table but unable to do so, could you please help me here.
aatached oml file for reference
API: https://lse-qa.axaltacs.com/ToteVerificationPortalAPI-DEV/api/OEMSystem/getToteMatchReport
Method: POST
body:
{ "Customer": "", "PlantLocation": "", "Status": "ALL", "FromDate": "", "ToDate": "2023-01-27", "CultureID": "en-US", "UserID": 258}
Response:
{
"data": [
"ToteVerificationID": "d0267b0f-688c-4c38-888f-0a8d7f895f50",
"Customer": "Ford",
"PlantLocation": "Dearborn",
"VerificationDate": "2023-01-24T07:49:17",
"VerifiedTime": "07:49:17",
"SystemType": "Regular",
"SystemNumber": "8",
"ToteMaterialCode": "1250045229",
"SystemMaterialCode": "1250090497",
"ToteNumber": "564",
"ToteMatchResult": "Fail",
"Comments": "Wrong Tote",
"ToteMatchResultID": 2
},
"ToteVerificationID": "b59287dd-b0ad-4b5c-9aa2-051735e73277",
"VerificationDate": "2023-01-20T11:20:24",
"VerifiedTime": "11:20:24",
"SystemNumber": "2",
"SystemMaterialCode": "1250045229",
"ToteMatchResult": "Success",
"Comments": null,
"ToteMatchResultID": 1
}
]
Hi @Pavan K
For display API response data in table, you can check attach discussion link.
https://www.outsystems.com/forums/discussion/83305/display-rest-api-response-in-list-table/.
Thanks,
sonali verma
Thanks but getting empty response.
Within the GetToteReportAPI Server Action, remove the whole loop, remove the ListAppend.It both didn't make any sense. For every data in the list, you tried to set the whole output response. And after that, with the ListAppend you tried to add one single data from the list again to the output response.
Instead, after the PostGetToteMatchReport, just place an Assign and set it to:
Total view of the method:
Thanks @Jeroen Bindels 👨🏽🚀 , As suggested changed the logic but still we are getting empty values.
The flow which i have created is Fetch data from other source in that API call with request and response changed as you suggested
In data is the list
Api Response:
{ "data": [ { "ToteVerificationID": "d0267b0f-688c-4c38-888f-0a8d7f895f50", "Customer": "Ford", "PlantLocation": "Dearborn", "VerificationDate": "2023-01-24T07:49:17", "VerifiedTime": "07:49:17", "SystemType": "Regular", "SystemNumber": "8", "ToteMaterialCode": "1250045229", "SystemMaterialCode": "1250090497", "ToteNumber": "564", "ToteMatchResult": "Fail", "Comments": "Wrong Tote", "ToteMatchResultID": 2 }, {
Fetch data from other source
But still unable to see the response data in table not sure where i am missing here
Got it, whenever some fields in the request header are empty, they are not sent to the API. When testing the API, you can perfectly try the Customer="" field, but during runtime (the actual page refresh), the field is empty and thus removed from the call.
You can fix this by setting 'Send Default Value' to Yes, for every attribute in the API request structure:
Thank you soooo much it worked now. Have a great weekend