Hi Team,

I am trying to consume the REST API which is having json body as request , for that i have tried the following attached process 


if we observe above i have assigned values to my variables and after that i am assigning that variable to JSONSerialize then assigning that variable to the request, but when i observe in debugger "WASP_USER" getting empty array., what causing the issue i am unable to understand can someone let me know how to fix it.


Regards

Harish

Hi Harish,

You're going about this the wrong way. When you use REST, the typical and preferred way is to use Structures to fill your data, have an Input Variable of that Structure type, and OutSystems will convert your Structure to JSON. Do not serialize your data yourself, unless you know fully what you're doing and why you're doing it! Please check the documentation for further information.

As for what's wrong in the above code, I notice you assign the Current record outside a For Each, which leads me to believe the List is empty, and you're assigning to the Current of an empty List, which is something you should never do. Did you take the free OutSystems courses and training at all? Because it seems to me you are not sure at all what you're doing.