REST Json Response missing values
Application Type
Reactive
Service Studio Version
11.14.1 (Build 54682)

Hi there!


So I'm making this call to a RESTFull internal web service

curl --location --request GET 'http://{Server}:{Port}/GetOrderDetailByBox?label=P0GPXFCUYK2MLG'


And using postman I receive this response

{

    "CODDEP": "300209",

    "NUMENCINT": "1179728",

    "NUMENCDEP": "SV22032901",

    "DATAENC": "2022-03-29T00:00:00+01:00",

    "DATAENTDESEJADA": "2022-03-30T00:00:00+01:00",

    "NOMECLIDEST": "SDV S.Ma.Feira",

    "LOCPOSTDEST": "SANTA MARIA DA FEIRA",

    "CB": [

        "P0GPXF0GM6VI6D",

        "P0GPXF0GM6VITU",

        "P0GPXFCUYK2M36",

        "P0GPXFCUYK2MLG",

        "P0GPXFCUYK2MMH",

        "P0GPXFCUYK2MNI",

        "P0GPXFCUYK2MO2"

    ]

}


But what I see on my OS App is this

LOCPOSTDEST is empty when it shouldn't be as is the CB list. The App knows there are 7 elements but the values are empty.

Oh! And DATAENTDESEJADA is wrong too.


Any ideia why?


Thank you!

could you please provide structure to store the API response. Also what is the data type of CB array elements.

You can try one thing when you consume the method you can create also the structure. Or you can copy that json, and see if your structure is equal to what you are getting from the API, like this.

Then it's going to create your structure, then you just need to see if you are assigning it well all the fields.

Let me know if it helps.

Another thing you can do is when you are consuming the method you can check what is retrieving by clicking in test

And then click finish, and will create the method and the output structures automatically.

If you provide your OML would be easier to help you.

Regards,

Márcio

Hi Márcio,


I did the steps you mentioned to add the REST Method and OS created the following structure

But the problem remains.


I also tried to your first method and created a new structure from the JSON payload, but I can't seem to be able to use it, because it's not on the available structures for the response variable




The OML, sorry but I cannot provide it because it's a company project. And even if I could you will not be able to access the WS.

Hi Tiago,

Can you please check the result out put of below rest API. I am able to get all the data in structures 

https://dbaghel.outsystemscloud.com/CustomDropdown/rest/RESTAPI1/RESTAPIMethod1

Also please check Name in JSON property of the attribute in your structure and OnAfterResponse of your REST consume method.

Best Regards

Devendra


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