SOLVED

PowerApps Send Email Using Variable for Recipients

Deleted
Not applicable

I can send an email in PowerApps to multiple recipients using this code. 

 

Office365.SendEmail("username1@abc.com; username2@abc.com;", "Test PowerApps Email", "This is a test.")

 

How could I rework the code to reference a variable instead of a string?

 

With my screen selected, I set OnVisible to:
Set(VarEmailRecipients, "username1@abc.com; username2@abc.com;") 

 

However this code did not work. 

Office365.SendEmail(VarEmailRecipients, "Test PowerApps Email", "This is a test.")

Any recommendations?

4 Replies
It's probably storing each item as an object / record or something, what's it look like if you look at the variable on the view tab inside of powerapps editor?

powerapps var.PNGHere is a screenshot of the var.  I don't know why it says "No value" as I have run it several times and would think it would be populated. 

best response
Solution
I just tested this it worked just fine. When you tested it, did you make sure you navigated away from the screen and back so it triggered the variable data? Put a label on your screen as well you can make sure what the data looks like for troubleshooting when you click it.

I had just started so I only had a single screen. I created a 2nd screen, a button to navigate from screen 2 to screen 1 and the var was successfully echoed to the screen. Thx for the help!

1 best response

Accepted Solutions
best response
Solution
I just tested this it worked just fine. When you tested it, did you make sure you navigated away from the screen and back so it triggered the variable data? Put a label on your screen as well you can make sure what the data looks like for troubleshooting when you click it.

View solution in original post