android.intent.action.SEND_MULTIPLE

573 views
Skip to first unread message

Pete

unread,
Jun 26, 2022, 5:16:42 AM6/26/22
to Automate
I can't seem to get this action to work in the app start block. To send a single file the following works in the extras field where file is a variable storing the file content provider...

{"android.intent.extra.STREAM" as Uri: file}

Any idea on how to get multiple files in the extras? Below is the doc on the action from Google but I can't seem to figure out how to apply it to automate.  Thanks 

Pete

unread,
Jun 26, 2022, 5:26:44 AM6/26/22
to Automate

Henrik "The Developer" Lindqvist

unread,
Jun 26, 2022, 12:36:52 PM6/26/22
to Automate
Try Extras=
{ "android.intent.extra.STREAM" as UriList: [ fileUri(file1), fileUri(file2) ] }

Also ensure to select the appropriate "Grant.." flags in the App start block.

Pete

unread,
Jul 3, 2022, 2:37:28 AM7/3/22
to Automate
Thank you henrik ...it works.

{"android.intent.extra.STREAM" as UriList: ["content://com.llamalab.automate.provider/flows/783/data", "content://com.llamalab.automate.provider/flows/2846/data"]}

P. Andreas Schmidt, IVE

unread,
Jul 5, 2022, 12:22:19 PM7/5/22
to Automate
Sorry for hooking in here on this thread with my own problem, but it's related. I'm trying to use the same feature, sending multiple files to WhatsApp, but I wanted to allow for picking the files to be sent, so I can't hardcode the URI's into the block.
Now I've tried creating an array where after every pick file block a new element is added with fileUri(file, "a").
In the Start App block I've then put in  {"android.intent.extra.STREAM" as UriList: ["{join(arrayfiles, "\", \"")}"]}
I've also tried to join the array with just ", " but both didn't work. When I manually put in different file URI's then WA accepts it, but if I fill it in this way, from an array it doesn't... For some reason it isn't transmitted as an array, as a URIList, but as a string. I can see it in the Intent catcher app. In the manual version the files are separate items, no "," in between, with the other attempts, the comma and the hyphens are shown...

Any idea how to fix this? What am I doing wrong, what else could I try?

Thanks in advance!

Henrik "The Developer" Lindqvist

unread,
Jul 5, 2022, 12:59:24 PM7/5/22
to Automate
The join function to use to concatenate an array into a single text, not what you're trying to do.
To pass your arrayfiles, if it's an array of filenames where each already passed through fileUri, then simply do:
{"android.intent.extra.STREAM" as UriList: arrayfiles }

P. Andreas Schmidt, IVE

unread,
Jul 6, 2022, 5:16:04 AM7/6/22
to Automate
Thanks so much, Henrkik, what a saver! I didn't know / hadn't thought of that you could just pass on variables... silly me :D It worked like a charm!
Reply all
Reply to author
Forward
0 new messages