Not working

84 views
Skip to first unread message

Juan O

unread,
Jan 24, 2023, 7:05:50 PM1/24/23
to Automate
Currently I'm trying to have the user select through a choice dialogue and have the values of these choices merged as in added together... (the choices are sourced from a JSON file that is parsed using jsonDecode). From there I would like it to create a new dialogue to confirm that the value chosen will be combined using a dialogue with yes or back.  The issue I'm currently having is that the dialogue choice returns the indices rather than the values of the array itself... How would I go about getting the value info that the user has selected? Also how would I then grab specific portions of those values so that I can add the values together to create the new value. 

A very simplified version would be 

---------------------------------------------------------------
dialogue choice 

Choose options to Merge

option 0 " random text 8 random text"
option 1 " random text 78 random text 
option 2 " random text 1 random text 
---------------------------------------------------------------

user selects option 0 and option 2 

----------------------------------------------------------------------------------------
dialogue confirm 

You selected the following. 
 " random text 8 random text" & " random text 1 random text"
------------------------------------------------------------------------------------------

Merge                                                               Go back 


Henrik "The Developer" Lindqvist

unread,
Jan 25, 2023, 8:43:28 AM1/25/23
to Automate
Assign the Choices input argument of the Dialog choice block an array, then use it to get the ones the user chose, maybe using the sift function to filter them, e.g.:
  • Variable set: choices=["foo", "bar", "bax"]
  • Dialog choice: Choice=choices, selected indices=selected
  • Dialog confirm: Message: You selected the following {sift(choices, selected);join; & }
Reply all
Reply to author
Forward
0 new messages