Hello,
I have a collection which contains a table and in that table are a couple of E-Mail addresses.
ClearCollect(
colMatrix,
{
Category: 1,
Addresses: [
"test1@email.com",
"test2@email.com"
]
},
{
Category: 2,
Addresses: [
"test2@email.com",
"test3@email.com"
]
}
);
Based on which Category is chosen I want to send an E-Mail to all addresses which are in the given table.
I tried it with SendEmailV2 and Concat but I couldn't get it to work. I also tried set in combination with Concat to create a variable which contains the recipients which then could be placed in SendEmailV2 but that didn't work. How do I need to setup the SendEmailV2 in order to get this working?
Any Help would be appreciated, Thank you!
Solved! Go to Solution.
I haven't tried this solution at the time so I can't say if it works or not but I found another one that works in my case. I assigned a variable to each email and used a switch case in order to chose the combination I need depending on the value of "var". It looks something like this:
Set(
mailA,
"first@mail.com"
);
Set(
mailB,
"first@mail.com"
);
Set(
mailC,
"first@mail.com"
);
Office365Outlook.SendEmailV2(
Switch(
var;
1;
mailA & ";" & mailB & ";" & mail C;
2;
mailB;
3;
mailC),
"Subject",
"Body"
)
Hi @LeonAtWork ,
If you use power automate we can send email to multiple user at a time
follow this link - https://www.damobird365.com/easily-send-email-mail-merge-with-attachments/
If you still facing problem Ping me here ,
Thanks,
Chitrakant27
A solution in Powerapps would be preferred. And how would you chose between different Categories in that scenario?
Hi,
From Start You created Table in a Table and that is a problem for Concat Function also this is not how SharePoint Store Records so if You collect data from SharePoint to colMatrix You don't Get what You need.
You need data set in Records and Yes it will show a lot of category 1 in column Category but we will deal with it:
ClearCollect(
colMatrix,
{
Category: 1,
Addresses:"test1@email.com"
},
{
Category: 1,
Addresses:
"test2@email.com"
},
{
Category: 2,
Addresses:
"test3@email.com"
},
{
Category: 2,
Addresses:
"test4@email.com"
}
);
Create a Dropdown and use Distinct to show only Unique values of column Category by placing to Item Property this Code
Distinct(colMatrix,Category)
We going next to create Send button in OnSelect of the button we will create variable what will be a result of Filter base of the dropdown and then we will use SendEmailV2 to Send email as below
Set(
varEmail,
Filter(
colMatrix,
Category = Dropdown1.Selected.Result
)
);
Office365Outlook.SendEmailV2(
Concat(
varEmail,
Addresses,
";"
),
"Test",
"Body Test"
)
Hope this helps
I haven't tried this solution at the time so I can't say if it works or not but I found another one that works in my case. I assigned a variable to each email and used a switch case in order to chose the combination I need depending on the value of "var". It looks something like this:
Set(
mailA,
"first@mail.com"
);
Set(
mailB,
"first@mail.com"
);
Set(
mailC,
"first@mail.com"
);
Office365Outlook.SendEmailV2(
Switch(
var;
1;
mailA & ";" & mailB & ";" & mail C;
2;
mailB;
3;
mailC),
"Subject",
"Body"
)
User | Count |
---|---|
247 | |
106 | |
82 | |
51 | |
43 |