Forum Discussion

Deleted's avatar
Deleted
Feb 25, 2019

PowerApps Send Email Using Variable for Recipients

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?

  • 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 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.
    • Deleted's avatar
      Deleted

      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!

  • 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?
    • Deleted's avatar
      Deleted

      Here 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. 

Resources