Unable to set page var (text) based on value

Hello :slight_smile:

I want to set the page variable to a component’s input field’s value both are listed as text? but throwing me not possible.

You’d better bind the value field of the input component with a text-type page variable.

The issue is though, the input field needs to get the value initially from the data variable and then a user can edit the field value and that new value should be used to send a REST API request. For whatever reason, something so basic seems impossible in Appygyver (or to me).

Well, try the following:

Create a page Variable called testValue

Suppose you have a data variable called dd_db1 and it has two fields id and location

In page, add two nodes, an event on Data changed and link it to Set page variable
image

Then set the node fields as below:
image

Note the formula should be like this:
image

Link the input box component’s value field to testValue page variable.

All the best

Thanks for taking the time. In my specific case didn’t manage, will try again tomorrow after some sleep :smiley:

What you showed made me think of another potential way

When the page is loaded set page variables to the specific fields in db (vendor) and then set input fields to the set page variables. Edit For some reason fields are blank but when I add delay it works

This might work, but there is one potential problem. In the most likely scenario, you get a null or undefined value if the data variable has not been populated/retrieved data yet. So that is why I used the event on data changed.

Another solution I could think of is using a Delay node, but it could be costly if it retrieves data every second.

Hi yes I didn’t show it on the picture but added an event delay note (and changed data loop logic only to fetch when the page opens). The problem I run into with your original suggestion is that I have like 14 fields to look out for.

another way I could see is something like when the input field changes - set the page variable or change data variable?