13
Views
3
Comments
Solved
Consume Rest API - Nested Request Object
Question

Hi, I try to consume a WS with a particular nested structure:


I assign correcttly the values for Request.StartDateTime, Request.EndDateTime, but not for 

Request.Participants.Attendees.Current.Identity.User.Id

or 

Request.Participants.Attendees.Current.Upn

When I debug the assignation, the list is empty, respect to assign in the previous step

In fact the json request is only

{"startDateTime":"2020-09-30T11:27:21.3524945+00:00","endDateTime":"2020-09-30T11:27:21.3524945+00:00","subject":"PAOLO 100"}

I'm waiting for a json like:

{

"startDateTime": "2020-09-30T11:27:21.3524945+00:00",

"endDateTime": "2020-09-30T12:27:21.3524945+00:00",

"subject": "PAOLO100",

"participants": {

 "attendees": [{

 "identity": {

 "user": {

 "id": "yyyyyyyyyy"

 }

 },

 "upn": "xxxxxx.com"

 }

 ]

}


}


Where is my error?

Thanks

Rank: #132
Solution

Hi Francesco,


You need to a list append to add a record to the List.

You need to create a variable from type Attendee record, assign the values you want for that variables attributes (UPN, identity), like this:


And then add the attendee to the list using ListAppend (from System) like this:

Hope it helps.


Cheers,

João Marques

Hi Joao, 

thanks for your solution. When I use Outystems, I imagine magically works all :D

Rank: #132

No problem, I'm glad I could help you :)

This is actually the kind of situation that helps when one is starting with OutSystems but you'll come around quickly.


Cheers,

João