Dynamically saving data to the right field without specifying in workflow

There is a button on my app’s page that opens a pop-up and triggers a response from ChatGPT. This response is this displayed in the pop-up. If the user wishes to use this response they can click a button under this generated called ‘Use this text’.

The workflow behind this button is intended to save this text to the relevant field. I can specify this field in the workflow, and that part is fine - but the blocker arises as there will be multiple buttons on the page for the user to create GPT responses and have this pop-up appear. So ideally I’d have just one pop-up that can be dynamically correspond to each of the fields. However, there’s no way I can find to tell Bubble to select XYZ field because the user clicked a specific button on the page that relates to different fields. At the moment the same pop-up and workflow for the save button appears for all fields which means there’s nothing unique in the workflow to distinguish between fields when saving.

The only way around this that I’m aware of would be to create multiple ‘Use this text’ buttons that would show/hide depending on which button on the main page was clicked. Then whatever button would appear would link directly to the field in question to save the text to, thereby not needing any dynamic workflow to determine what field in question needs to be updated.

I’d use the workaround as I suggested above, but it’s a bit clunky and not quite efficient.

See if i got it correctly, You have multiple buttons which open a single popup and get a response from ChatGPT and in that popup you have a button which save the response in database depending on which button is being clicked right.

Now you can’t sort when you are saving the response that because of which button is this response generated.

A simple solution i would suggest, is add a custom state on popup type text. when a button is cliekd which suppose to open that popup also fill the a value related to button on custom state. now if user whant to save it with save button, see useing the custom state which button is clicked and save to it using only when.

i hope i got your question correctly and this ans help you :slight_smile: