How do I display REST Response?

  
Hi.

I'm trying to display the response that I get from consuming this REST API.



It says in the tutorial to assign the response to a variable then display it on a table record. I'm trying to do just that but it keeps on rejecting saying that the data type required is a 'Record List' instead of 'GetGreetingResponse'.



I've actually been at it the whole day yesterday and still couldn't figure out how to do it. How do I display the REST Response?

Thanks!
You could display the response in a table if your response was a list of something. Since your response is a structure with an integer and a text, you could use an expression instead of the table. 
Rui Covelo wrote:
You could display the response in a table if your response was a list of something. Since your response is a structure with an integer and a text, you could use an expression instead of the table. 
Hi.

Thanks for the response!

I'll try out displaying it as a table since I'd like to display it as a list instead of just plain texts. Most of the REST APIs that I'll be using will actually return lists. I'm just trying it out with this one before moving on to my other APIs.
 
In that case, if you have values that are not in a list but you want them to be in a list, you need a variable of the type record list and add records to it using ListAppend. There are more than one way to do this but from the top of my head (I don't have ServiceStudio here at the moment) you probably already have a structure that represents the response of that REST API. You can create a variable which is a list of records of the type of that structure and use ListAppend to add items to it. That record list must be assigned to the table off course. If you don't have that structure already, create one. 
Hi.

Thanks again. Sorry for all the questions. Really just starting out. I've actually tried putting a structure in a variable of a structure list type and it still rejected it saying it requires a list instead of the structure. How would I assign it then?

We like questions.


You should have something like this for the structure:
 


And something like this for the variable that gets assigned to the table



If you double click "Data Type":




If you use the drop down instead of double click, select this:


And then this:




If you drag the ResponseList variable to a screen it will automatically create a table for you assigned to that variable.

Now you only need to use ListAppend to add the response of the REST service to the ResponseList variable and regresh the table. 


Oooh. I get it. ListAppend is called with an Execute Action. I was able to display it already as per your instruction.



Before this, I was trying to get it in a variable using Assign instead of the Execute Action. I wasn't aware of the actions.

Thanks a bunch! Specially for the screens.

Would be nice if consuming REST APIs had the ListAppend added to the tutorial.