46
Views
2
Comments
Solved
Reactive Web: How to populate input field from REST get
Question
Application Type
Reactive

Problem in a nutshell:

I have a list page that I am able to populate from a REST get that returns a list.  No problem.  If you click on an item, it goes to a details page.  It correctly passes in the Id and even calls the data action that gets the data.  How do you get this data from the rest call onto the details page?  If I was doing traditional web, no problem, but it is hard to find an answer on how to do this for reactive.  Here's the details:

I have this rest service:

Which takes in an Id and returns the data structure.  I have a form with fields for the data:

The form has local variables for the inputs:

And the inputs reference those variables:

The Get category Data action correct gets the data from the rest API and assigns it to it's output variable:

That's where I get lost.  How do I get the result from the data action into the form fields?  I have the variables set up, but they're not in scope of the data action and can't be assigned directly.  

What am I doing wrong?  Literally everything else in this app works except this 1 thing. Thanks!

2018-10-29 08-31-03
João Marques
 
MVP
Solution

Hi Ryan,


The data action runs on the server side, so the local variables which are on the client side are out of scope there.

The way to do it is to have an OnAfterFetch which will assign the result of the data action (and the REST API basically) to the local variables:


If you are not getting any data there, I would suggest to debug to make sure that the API is actually delivering values.


Kind Regards,
João

UserImage.jpg
Ryan Brooks

Joao,

Thanks for your help.  This was the right solution.

Ryan

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