429
Views
6
Comments
Solved
How do I use REST response data in my screen? (All details, please)
Application Type
Reactive
Service Studio Version
11.53.11 (Build 61107)

Quick first order of business, I am a traditional developer with over 35 years experience in development and design.  After being severely frustrated with the capabilities of other low-code platforms I have arrived here with great expectations :)

Because I am an experienced developer I am of course trying to run before I can walk, but this may be partially excused as a need to get going and be productive as soon as possible.  My apologies if I have missed something that is obviously answered elsewhere. Any relevant reference links will be appreciated as well as direct responses.

My issue:  

  1. I have a REST call defined and tested successfully in the Logic tab; Let's call it GetBigThings.
  2. I have a screen in the Interface tab that receives a CODE as an input parameter.  The CODE is used as a parameter to the REST call so that I get the desired set of BigThings returned to me.
  3. I want to make the REST call, receive the results, and ultimately display the results in a List Widget on my screen.

My Questions:

  1. When the response from the REST call arrives, where is it?
  2. What do I need to do (that is, what are the objects I need to create and steps I need to take) to make it usable as the source of values that will be displayed in the list?

If you are kind enough to respond, please explain all of the detail no matter how trivial, not making any assumptions about what I should already have in my app or what I already know.  I am very new to this (3 days in, approximately).  Thank you in advance, and I look forward to a long and productive relationship with the development community here.



2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP
Solution

Hi Joseph,

Welcome to OutSystems!

To add to the correct reply already shared to define a Fetch from Other Source Data action, here is an official OutSystems training video that also explains the process:

https://www.outsystems.com/training/lesson/1850/retrieving-data-from-a-rest-api-get

I feel you, when I started with OutSystems, I also struggled initially to let go the patterns and way of work I was used to for many years. My advice go the the OutSystems training material it is really good. All I know is mostly learned from watching the online training material.

Just google the topic "Outsystems <your topic>" and a big change there is a training video or presentation.

Regards,

Daniel

2022-08-04 22-34-39
Joseph Ackerman

@Daniël Kuhlmann , thanks, this did the trick.  Dragging the output into the flow for assignment got me access to the data I needed on the screen.  Once I had assigned all the bits and pieces on the property panel on the  right, I could do what I needed. On to the next problem! :)

2021-06-25 10-02-19
Henrique Ferreira

I might be of help in this matter:


You are consuming the API "GetBigThings".

This will have a request. That request will have the input CODE from the interface.

The way to get the response is to test the API in the test tab on the API OutSystems interface, this one:

once you have written the Request in JSON, you can click on test and that will generate a response on the "Response test result" box. 

Next you need to copy that response to body (by clicking the button on the bottom) and click finish. 

That will create the response automatically in the form of a structure.

You can use that structure for logic or simply to use it in the widgets interface.

Hope it helps

2022-08-04 22-34-39
Joseph Ackerman

Thanks for the quick response.

As I said in my original post, I have already got the response and "copied it to the body" and saved all of that.  That's not my issue.

You say: "You can use that structure for logic or simply to use it in the widgets interface. "

Okay, great.  HOW?  Specifically?  

I right-click on my screen name and select Fetch Data from Other Sources.

That creates an item in the tree which I name GetBigThings.  Under that there has been created for me an output parameter called Out1.

I also see this thing on the canvas to the left:

And there is now an Error in the Error and Warnings tab at the bottom of the screen:

What I want to do is:

  1. Get rid of the error message
  2. Use a subset of the returned JSON structure (an array of objects [{},{},{}...] to populate the list on my form.

How EXACTLY do I do this?  What do I do now, step-by-step?  Sorry but this is just not intuitive to me as my background is to do everything in code [ yes, I am a dinosaur:) ]

Thanks.


2021-06-25 10-02-19
Henrique Ferreira

Oh, sorry if I miss that on your original post.


Ok, than it is better than I thought.

So, now, you have to drag an assign widget ( on the left column of the service studio) to that flow that you showed on the screen and assign the Out1 to the API response.

Then you have that action that outputs the structure.

To use it on the screen, build a data action like this


To build a Data action:

on the interface, right click on the screen (in the elements tab on the right side), and add data action. This is an asynchronously server call. that will allow you to drag the API action and access its output

I would suggest building a wrapper for the API.

I understand that you want to get in asap in the OutSystems world. 

In order to do it in the most efficient way, and since you have experience in the developing world, I would advise checking the learning paths. It will give you the insight into this little things that makes the bridge between traditional developing and OutSystems.


I will be around if you need more help.

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP
Solution

Hi Joseph,

Welcome to OutSystems!

To add to the correct reply already shared to define a Fetch from Other Source Data action, here is an official OutSystems training video that also explains the process:

https://www.outsystems.com/training/lesson/1850/retrieving-data-from-a-rest-api-get

I feel you, when I started with OutSystems, I also struggled initially to let go the patterns and way of work I was used to for many years. My advice go the the OutSystems training material it is really good. All I know is mostly learned from watching the online training material.

Just google the topic "Outsystems <your topic>" and a big change there is a training video or presentation.

Regards,

Daniel

2022-08-04 22-34-39
Joseph Ackerman

@Daniël Kuhlmann , thanks, this did the trick.  Dragging the output into the flow for assignment got me access to the data I needed on the screen.  Once I had assigned all the bits and pieces on the property panel on the  right, I could do what I needed. On to the next problem! :)

2022-08-04 22-34-39
Joseph Ackerman

Thanks so much @Daniël Kuhlmann and Henrique Ferreira.  This is exactly the kind of information I was looking for.  I'm off to the learning path and will check back with progress.

Much obliged, and thanks again.


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