Passing MORE text with button click to API call

My case:
API calls with lots of dynamic inputs. Trying to simplify for the user and make the app look clean.

Right now I have one API call in the plugin with a dynamic < input > that pulls data from a hidden input element with almost every dynamic value needed.

Can I pass in unique text I do not want the user to view when clicking a button to call the api in addition to the hidden input element? I’ve tried arbitrary text and setting state.

I’m hoping there is an easier way than creating 9 separate api calls in the plugin with multiple dynamic inputs.

Thanks!

Hi @will.nft.works :wave:

I don’t understood what you want.
Could you share some images of a video with us?

Won’t have my laptop until the morning.

Can I pass in unique text with a button click only? Unique as in not saved as a hidden input element on page.

I have an an OpenAI API call to generate code from a prompt. I want my Generate Button to pass in the text “please generate code for this example:”

I could easily put that in the prompt if that were the only thing this page does but that isn’t the case.

Thank you for the quick reply

If I understand you correctly, all you’re trying to do is concatenate some string ("please generate code for this example: ") with the user’s input. It’s true that the small text inputs (as you’d find in API call actions) are no good for this, but you can always use the Arbitrary Text operator to call up the “long text” input field.

So you could either do that, or do the string concatenation as a set state action, like this:

(Note how there’s no need for storing your static values in a hidden input or state this way. I get why you did that, but you don’t need to do that.)

2 Likes

Thank you so much. Exactly what I meant to say.

Really appreciate you sending over the screen shots. Thank you!