By Andrew Sherman @Andrew_Sherman
I'd like to have a dialog prompt at the beginning of one of my scripts. How do I get the contents of this as a string (entered by the user) and assign it to a variable?
sf.interaction.displayDialog({
defaultAnswer: "Client-Brand-PersonName",
buttons: ["Enter", "Cancel"],
defaultButton: "Enter",
cancelButton: "Cancel",
prompt: "Enter details",
giveUpAfterSeconds: 5,
});
Linked from:
- Christian Scheuer @chrscheuer2021-05-25 11:47:21.236Z
Just take the
text
output property :)var text = sf.interaction.displayDialog({ defaultAnswer: "Client-Brand-PersonName", buttons: ["Enter", "Cancel"], defaultButton: "Enter", cancelButton: "Cancel", prompt: "Enter details", giveUpAfterSeconds: 5, }).text; log(text);
- AAndrew Sherman @Andrew_Sherman
Great, thank you Christian
- In reply tochrscheuer⬆:AAndrew Sherman @Andrew_Sherman
Hi Christian,
Is there a way to get multiple different variables from a dialog (or filling in a form)?
Christian Scheuer @chrscheuer2021-06-17 14:18:23.276Z
Not currently - not without building a SF app, but that requires having gone through our developer program which is currently invite-only.
- AAndrew Sherman @Andrew_Sherman
Ok no worries, I can do what I want a different way, thanks.