404
Views
11
Comments
How to pass consumed rest API response to the table
Question

Can you please help me in sending the response into the table, I'Am getting the below error and help me in fixing the error?

2016-04-22 00-29-45
Nuno Reis
 
MVP

Hello Rithika.

The API is returning a single record. A table needs a list of records.

You can append the response to that list and use the list (notice that the table would have a single row) or just replace the table by a form and show that record in detail.

UserImage.jpg
rithika gujjula

Nuno Reis wrote:

Hello Rithika.

The API is returning a single record. A table needs a list of records.

You can append the response to that list and use the list (notice that the table would have a single row) or just replace the table by a form and show that record in detail.

Can you help me in appending the record to the list??


2016-04-22 00-29-45
Nuno Reis
 
MVP

Right after you call the API, use ListAppend action.

In List fill UserList

In Element fill DataAction1.Out1


That way you will have the content of Out as a list of size one.


If you don't see ListAppend, go to References and add it. It is under (System).

UserImage.jpg
srikanth boddapati

Nuno Reis wrote:

Right after you call the API, use ListAppend action.

In List fill UserList

In Element fill DataAction1.Out1


That way you will have the content of Out as a list of size one.


If you don't see ListAppend, go to References and add it. It is under (System).

After setting the List what should be set in the output  parameter of data action??


UserImage.jpg
rithika gujjula

1)How to send the access token to the get API?

2)can we store API response in local variable?

Can anyone help me with these questions?

2016-04-22 00-29-45
Nuno Reis
 
MVP

I see you started doing the online training. That is the best way to learn. The forum is the next step, for when you have doubts or something is not working.

You can check the pages on consuming APIs

https://success.outsystems.com/Documentation/11/Extensibility_and_Integration/REST/Consume_REST_APIs

https://success.outsystems.com/Documentation/11/Extensibility_and_Integration/REST/Consume_REST_APIs/Consume_One_or_More_REST_API_Methods

You can look at the demo included with https://www.outsystems.com/forge/component-overview/3058/google-sheets-connector

Yes, you can save the API response in local variables or database.

2016-04-22 00-29-45
Nuno Reis
 
MVP

That question doesn't make sense. Can you send a screenshot?

UserImage.jpg
srikanth boddapati

Nuno Reis wrote:

That question doesn't make sense. Can you send a screenshot?

After setting the List what should be set in the output  parameter of data action??

2016-04-22 00-29-45
Nuno Reis
 
MVP

Regarding assignments:

Value is what you want to save locally.

Variable is where you will save it.

Out1 is no longer relevant (you already move its content to UserList) so you can delete that Assign.

UserImage.jpg
srikanth boddapati

Nuno Reis wrote:

Regarding assignments:

Value is what you want to save locally.

Variable is where you will save it.

Out1 is no longer relevant (you already move its content to UserList) so you can delete that Assign.

How to set the value for output parameter??

2016-04-22 00-29-45
Nuno Reis
 
MVP

On ListAppend.

But you changed more things. Where is the UserList you had before? It should be "append Out1 to UserList".

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