Checklist

General discussions about Automagic and automation in general

Moderator: Martin

Post Reply
troppodel
Posts: 7
Joined: 20 Mar 2014 13:32

Checklist

Post by troppodel » 21 Mar 2014 13:11

Hi Martin
I'm just creating a new flow when I input a text message with value variable and send sms after confirm.
is it possible create a condition with a checklist and flag the recipients that I want send a sms?
example:

input text
write text and use value variable
condition select the recipients
a
b
c
d
Select
Action send message sms

thanks buddy

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Checklist

Post by Martin » 21 Mar 2014 17:22

Hi,

An action Input Dialog with type Multi Choice should work when you only need a few numbers in the selection and not the complete address book.
You can type a comma separated list of numbers into the field List Values and show the selected values for testing purposes on screen with variable replacement {value,listformat,comma}.

A simple test-flow could look like this:
-trigger <empty>
-action Input Dialog: Multi Choice: 1,2,3,4,5
-action Notification on Screen: {value,listformat,comma}

Please also read the help page of action Input Dialog since the action also provides some other variables that might be interesting to check before sending the SMS (especially variable operation).
You could add following condition before sending the SMS:
-condition Expression: not isEmpty(value) and operation=="ok"
This condition will check that a value was selected and that you confirmed the selection with OK in the dialog.

Regards,
Martin

troppodel
Posts: 7
Joined: 20 Mar 2014 13:32

Re: Checklist

Post by troppodel » 21 Mar 2014 22:47

I will try as soon I can thanks buddy I really appreciated
Ivan

troppodel
Posts: 7
Joined: 20 Mar 2014 13:32

Re: Checklist

Post by troppodel » 21 Mar 2014 23:03

Ok works Martin but now I need to show the names in the checklist norification but use their numbers like value (if I show the numbers it is very hard understand who is the owner)
is it possible?

here the flow

http://automagic4android.com/flow.php?i ... 4de38ce701

Thanks

Regards
Ivan

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Checklist

Post by Martin » 22 Mar 2014 12:51

Unfortunately there's no option in the action Input Dialog to display one list of values and provide other values to the flow. Let me add this to the todo-list.

For now you could use an action Script and a map containing the phone number for each contact. The script is a little bit complicated since your flow has a multi-selection dialog.
Following script should work (insert between condition and notification):

Code: Select all

//create a new empty map
map = newMap();

//add your contacts to the map
addMapEntry(map, "contact1", "1111111");
addMapEntry(map, "contact2", "2222222");

//create a list that will contain the phone numbers
numbers = newList();

//loop to process each selected contact name stored in the list 'value'
for (contact_name in value)
{
   //look up the contact in the map and get the corresponding phone number
   number = getMapValue(map, contact_name);

   //add the phone number to the list of numbers
   addElement(numbers, number);
}
Lines starting with // are comments, you can skip those lines.

You can switch the variable replacement in the Notification on Screen to {numbers,listformat,comma} to show the phone numbers.

Regards,
Martin

troppodel
Posts: 7
Joined: 20 Mar 2014 13:32

Re: Checklist

Post by troppodel » 23 Mar 2014 13:46

Martin you are a great man thanks buddy I really appreciated and l love automagic.
let me know when you will add this feature in the next release.
Regards
Ivan

troppodel
Posts: 7
Joined: 20 Mar 2014 13:32

Re: Checklist

Post by troppodel » 23 Mar 2014 13:57

Hi Martin from all members here the flow work very fine

http://automagic4android.com/flow.php?i ... 7edae28017

thanks again

Post Reply