94
Views
6
Comments
Want to display response list of data in table
Application Type
Reactive

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",

            "Customer": "Ford",

            "PlantLocation": "Dearborn",

            "VerificationDate": "2023-01-20T11:20:24",

            "VerifiedTime": "11:20:24",

            "SystemType": "Regular",

            "SystemNumber": "2",

            "ToteMaterialCode": "1250045229",

            "SystemMaterialCode": "1250045229",

            "ToteNumber": "564",

            "ToteMatchResult": "Success",

            "Comments": null,

            "ToteMatchResultID": 1

        }

        

        

    ]

}

ToteWebCopy.oml
UserImage.jpg
Accelance Partners

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


UserImage.jpg
Pavan K

Thanks but getting empty response.


2021-05-04 12-43-07
Jeroen Bindels

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:

UserImage.jpg
Pavan K

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

2021-05-04 12-43-07
Jeroen Bindels

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:

UserImage.jpg
Pavan K

Thank you soooo much it worked now. Have a great weekend

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.