Hi,
I have an invoice approval workflow which permits up to four separate approvers. What I want to do is send an email once per day to anyone who has invoices pending approval.
Through a series of select and compose functions, I can get the following (valid) list of people who should receive an email reminder. What I can't work out is how to extract the addresses for use in the 'To:' field of a 'Send Email' step. Any assistance would be appreciated.
Thanks. Don't know what I was thinking there!
Did you enter that into the expression editor? Not just pasted it in? Sorry if that part was not clear.
Thanks for the reply. Working through this now. I'm getting an "enter a valid json" message for the replace(substring(string(item()),7), '"}', '') step.
This would normally be very easy, but the naming of elements within your array are different throughout the array (E1, E2 etc). So you have to use an expression. This does what you want:
In the select action the "From" should be the compose that contains your email addresses. Then put the select into text mode, use this expression:
replace(substring(string(item()),7), '"}', '')
This is going to give you back a simple array that looks like this:
[
"Dxx@xxxxxxxxxxx.org.nz",
"axxxxxxxx@xxxxxxxxxxx.org.nz",
"Rxxxx@xxxxxxxxxxx.org.nz",
"fxxxxx@xxxxxxxxxxx.org.nz"
]
You can then use a compose action on the output of the select:
join(body('Select'), ';')
which will produce output like:
Dxx@xxxxxxxxxxx.org.nz;axxxxxxxx@xxxxxxxxxxx.org.nz;Rxxxx@xxxxxxxxxxx.org.nz;fxxxxx@xxxxxxxxxxx.org.nz;Dxxxx@xxxxxxxxxxx.org.nz;axxxxxx@xxxxxxxxxxx.org.nz;nxxx@xxxxxxxxxxx.org.nz;Hxxxx@xxxxxxxxxxx.org.nz;fxxx@xxxxxxxxxxx.org.nz;Hxxxxx@xxxxxxxxxxx.org.nz;nxxx@xxxxxxxxxxx.org.nz;axxxxxx@xxxxxxxxxxx.org.nz
Which you can use to email everyone at the same time.
Blog: tachytelic.net
YouTube: https://www.youtube.com/c/PaulieM/videos
If I answered your question, please accept it as a solution 😘
Tomac
986
Moderator
stampcoin
699
Super User 2025 Season 2
Riyaz_riz11
577
Super User 2025 Season 2