how to populate requestbody with variables to make REST call

Hello,

I am trying to develop a REST call to an Progress Corticon server.

I got it working with insomnia. The JSON looks like this:

I followed the procedure in studio to create the wright data structure.


The Request structure is of type Execute.

So I created an Local Variable Payload of Data type Execute

During the proces I assign all form varables to this Payload

Then I assig the Payload as Request to the Rest call

I assumed this might do the trick. 

Unfortunately it does not.The payload get populated as expected.

But then the Request looks only like this:


Where did I go wrong?

What to do to solve this issue?

BTW: the call itself is Ok, I get a 200 as reply, but the function wasn't triggered in the wright way because of missing variables.


Thx.

Solution

Hi Bé,

Only the name gets populated in the body, although in the screenshot it looks like it is also being passed as an URL Query Parameter...

Anyway, next to the name on your example there is a list Objects.

The issue is you can not assign .current. if the list item doesn't exist yet.

You should do a list append instead.

Since this is a fairly intricate object my recommendation is that you start  by populating the last children and work your way up.

It is a bit hard to explain using text but the principle is:

  1. Assign a list item
  2. List append the item to the list
  3. Repeat
  4. List append the item containing the list to the master list
  5. ... and so on...

Let us know if this helps

Cheers

PS2: Check out the example in attach

Solution

Rui Barbosa wrote:

Hi Bé,

Only the name gets populated in the body, although in the screenshot it looks like it is also being passed as an URL Query Parameter...

Anyway, next to the name on your example there is a list Objects.

The issue is you can not assign .current. if the list item doesn't exist yet.

You should do a list append instead.

Since this is a fairly intricate object my recommendation is that you start  by populating the last children and work your way up.

It is a bit hard to explain using text but the principle is:

  1. Assign a list item
  2. List append the item to the list
  3. Repeat
  4. List append the item containing the list to the master list
  5. ... and so on...

Let us know if this helps

Cheers

PS2: Check out the example in attach

Rui, thx for the explanation. 


Only this raises a new question to me. 

How is it possible then that the Payload gets populated as expected? 

This is a list structure also.


Bé Entjes wrote:

Rui, thx for the explanation. 


Only this raises a new question to me. 

How is it possible then that the Payload gets populated as expected? 

This is a list structure also.


Hi Bé

I've built an example for you.

Check the attached NestedLists.oml on my previous message

Rui,


I lookd into it and copied the way of working.

Ik works fin now.


Thx.