Multiline input not getting value of dynamically generated text

Hello,

I have multiline input and when I click a button it will generate some text and output in the multiline.
The text is generated by an API call.

The problem is that when I save it to database, the generated text is not being included. It seems it is not getting detected by the multiline.

The only way for the text generated to be detected is to do some manual edits on the multiline first.

How can I solve this issue?

Hi @hirayaleads,

you can add a custom state to the multiline input of type text and default value empty. And add a condition to the multiline input that changes the initial value when this state is not empty.

the condition set up:
image

Then finally, in the workflow that makes the API call, add a step that sets the state of the multiline to the piece of info that you want from the returned value. try it out it really works :slight_smile:

1 Like

Hi hanan! It works!

The only problem is that when I run the API call to generate text again is that it loses the previous text and will only save on the content state is the most recent text generation.

How can I put all the generated text into the custom state “content”?

1 Like

@hirayaleads no worries. You just need to make a few tweaks:

1. append the generated content to existing content:

2. Group the multiline in a group by itself, then add the following workflow when the multiline’s value changes: note that you need to reset the group as a second step.

let me know if you face any issues.

1 Like

Thank you so much! It worked :slight_smile:

Hello hanan,

I made changes to my app and struggling to make this work.

Can I send you a video?

Thanks

@hirayaleads yes please do share a video or a read only link and I’ll do my best to help :slight_smile:

This topic was automatically closed after 70 days. New replies are no longer allowed.