Oh, ok. Sorry for that I've no idea.
You need to import the phonebook somehow, but I don't know how.
Extract contact number from sms
Moderator: Martin
- TheBrain1984
- Posts: 137
- Joined: 07 Aug 2013 08:17
- Location: Germany
Re: Extract contact number from sms
Not sure if I understood your question. You could query the contacts database with action Query Content Provider to get a list of phone numbers and then pick one randomly.
The content URI to get the phone numbers is content://com.android.contacts/data/phones
Projection: data1 (column with the phone number)
Result Type: List
Variable: number_list
You can then use a script to pick a random number with function number = getRandomElement(number_list);
The content URI to get the phone numbers is content://com.android.contacts/data/phones
Projection: data1 (column with the phone number)
Result Type: List
Variable: number_list
You can then use a script to pick a random number with function number = getRandomElement(number_list);
Re: Extract contact number from sms
Thanks martin
But I want phone numbers from a contact group.
But I want phone numbers from a contact group.
Re: Extract contact number from sms
Unfortunately that's quite a complicated to achieve with action Query Content Provider since the contacts database is quite complicated by itself.
Here's a flow that might work: Phone of random coworker
-the first action determines the ID of the group called 'Coworker' of the defined google account (edit the action to use your account)
-the second action provides a list of all contact IDs in the group
-the third action picks a random contact from the list of contact IDs
-the fourth action reads the phone number of the contact and stores the number in variable contact
-the condition displays the variables created by the flow (group_id, contact_ids, random_contact_id, contact)
Note that the flow does not include any error handling so the flow will fail when the mail account or group does not exist.
Here's a flow that might work: Phone of random coworker
-the first action determines the ID of the group called 'Coworker' of the defined google account (edit the action to use your account)
-the second action provides a list of all contact IDs in the group
-the third action picks a random contact from the list of contact IDs
-the fourth action reads the phone number of the contact and stores the number in variable contact
-the condition displays the variables created by the flow (group_id, contact_ids, random_contact_id, contact)
Note that the flow does not include any error handling so the flow will fail when the mail account or group does not exist.
Re: Extract contact number from sms
Excellent. Thats what i need.
Thanks a lot Martin.
Thanks a lot Martin.