cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BlackDuck
New Member

DropDown selection in Email body for powerapp

Hi I have a very simple power app which is essentially a 'contact us' form that gets emailed to me.

 

It has a drop down selection which users can specify why they are contacting us (eg feedback, asking a question, requesting something new), a text field where they can put their email address (so i can respond) and then a text field they can provide their comments. I then have a button which sends an email to me with the content of their message. I have successfully got the email button working which includes the body of their comments and their email address. 

 

My question:

I want the dropdown selection to be included as the 'subject' of the email i receive ... but when i try i get an error, any suggestions? also please be simple in your explanations, this is my first powerapp and i am a complete noob.

 

THANK YOU

1 ACCEPTED SOLUTION

Accepted Solutions
wyotim
Resident Rockstar
Resident Rockstar

Hello @BlackDuck and welcome!

 

Without seeing the code you are using, I am going to take a shot in the dark and suggest what it could be. To access the text from a drop down named Dropdown1 you would use the following:

 

Dropdown1.Selected.Value

That will give the literal text that is selected in the drop down. To add it to another text string, you would use something like:

 

"Email subject: " & Dropdown1.Selected.Value

If you were using the Office365.SendEmail function, putting it in your subject line would look something like this:

 

Office365.SendEmail("myemail@mycompany.com", "Email subject: " & Dropdown1.Selected.Value, "Here is the text of the email")

or

Office365.SendEmail(emailAddress.Text, "Email subject: " & Dropdown1.Selected.Value, emailText.Text)

 

How it looks between those two will depend a bit on how your app is set up and I would be happy to follow up on this to work out the specifics of your situation if you would be able to provide an example of what you are trying code-wise. For starters though, I would make sure you are using Dropdown1.Selected.Value and not just Dropdown1.Selected.

 

Hope that helps, but let me know if it doesn't!

View solution in original post

3 REPLIES 3
wyotim
Resident Rockstar
Resident Rockstar

Hello @BlackDuck and welcome!

 

Without seeing the code you are using, I am going to take a shot in the dark and suggest what it could be. To access the text from a drop down named Dropdown1 you would use the following:

 

Dropdown1.Selected.Value

That will give the literal text that is selected in the drop down. To add it to another text string, you would use something like:

 

"Email subject: " & Dropdown1.Selected.Value

If you were using the Office365.SendEmail function, putting it in your subject line would look something like this:

 

Office365.SendEmail("myemail@mycompany.com", "Email subject: " & Dropdown1.Selected.Value, "Here is the text of the email")

or

Office365.SendEmail(emailAddress.Text, "Email subject: " & Dropdown1.Selected.Value, emailText.Text)

 

How it looks between those two will depend a bit on how your app is set up and I would be happy to follow up on this to work out the specifics of your situation if you would be able to provide an example of what you are trying code-wise. For starters though, I would make sure you are using Dropdown1.Selected.Value and not just Dropdown1.Selected.

 

Hope that helps, but let me know if it doesn't!

View solution in original post

Legend this worked!

My problem was i was inputing 'dropdown1.Selected' i hadn't added the '.Value' at the end - thank you so much!!!

wyotim
Resident Rockstar
Resident Rockstar

Happy I could help!

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,658)