Assigning a Variable Via a User Button Press?

Hi folks! I feel like this I'm gonna slap my forehead when someone tells me how easy this is to do, but I'm stumped.

I'd like to present the user with a dialog that allows them to click a single button and set a variable to the name of the button they clicked. (E.g., "Do you prefer coffee or tea?" with two buttons to click; the variable coming out of the dialog will be set to either "Coffee" or "Tea")

I know I can do this with a pop-up menu, for instance, but that's more clicks than I'd ideally like to require of the user.

Can someone point me to the easiest way to make this happen?

Thanks bunches in advance!

David

You're looking for the Prompt for User Action

Thanks, Evan—I actually had gotten that far. I just can't figure out how to get that action to set a variable based on which button is clicked rather than on a text entry, popup menu, slider, etc. (So in the screenshot example on that page, I'd want the "output" from the action to be either "OK" or "Cancel" as a string of text, if that makes sense?)

There's this:


...which gives you this:
image
...but it sounds like you want to click one button rather than select a radio button and then hit OK. Is that right?

Seems like you might want this?

image
image
with this
image

1 Like

Yep that's what I was reaching for. :+1:t3:

1 Like

Brilliant, noisnell and Evan_Mangiamele! It's that "%PromptButton%" that's the part my brain wasn't latching on to! Thanks so much for your help, both!

2 Likes