Hello,
I have an input field and a button and a text element. The text element uses dynamic data from the input’s value but I only want to update the text field when the user clicks the button. Currently as soon as you start editing the input field the text field that is referencing that input’s value. I cant figure out how to stop this? Any ideas? I was hoping that was a workflow to say set this elements text to this when click on button however that doesn’t seem to exist?
There’s probably an easier way but just off the top of my head, I’m thinking you could use a custom state. So you could put all three elements in a group and create a custom state for the group, e.g. one called ‘myText’. Then you could have a workflow triggered by a change to the input’s value, which would set the custom state myText to the value of the input. Finally, you would set the text element’s text to the value of myText.
Not able to try this just now but it should work. As I say, there’s probably an easier way but given that you can’t set the value of a text in a workflow as you say, this is the only way that comes to mind.
Put the text in a group and set the group type to text. The text’s dynamic expression would be “parent group’s text” instead of input’s value. When button is clicked: “display data” (group action) > select the group and the data to display is the input’s value.
Basically every time you click the button, you send a new text value to the group, and the text element reads off that instead of the input.
@louisadekoya’s solution is very similar to what I’m describing except instead of storing the value in a custom state, we’re sending it to the group. I only brought this way up in case setting up the custom state got confusing if you haven’t worked with it much.