cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dsab81
Microsoft
Microsoft

PowerApps - Default Selected Items - Canvas - Email ID in To:\

Hi,

I have a canvas mail app, where i have To:\ Cc:\ Bcc:\

I have  a To:\ combo box , the defaultselectedItems value is below.

dsab81_0-1618208048400.png

 

When i select the below , i am getting empty record, which means it is not recognizing the value from the 'default selected item'.

dsab81_2-1618208351293.png

 

But when i remove the default selected item , and manually go and select a email from a drop down, it is sending the email successfully to the person in To:

 

What is the wrong with picking the default selected item?

 

 

Just for understanding , here is my Sample canvas app 

dsab81_1-1618208254403.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
SafaK
Helper I
Helper I

Yes, that is correct, because you are saying ('ComboBox-To'.SelectedItems), where in the default case the item was not selected manually, therefore the value will be blank, so what you can do as a work around, you can set the selected value in a variable, and declare a this variable onVisible property for the screen, which means : 
1. go to screen OnVisible property, decalre new variable with the default value, 

SafaK_0-1618247966532.png


2. go to the Selected Default item in the comboBox and set it to the variable value,

SafaK_1-1618248026069.png

 

 

3. Onchange property for the comboBox change the value for the same variable 

SafaK_2-1618248064592.png



4. Use the variable value to send email ,

SafaK_3-1618248106043.png



This should work now 🙂 

 

View solution in original post

3 REPLIES 3
WarrenBelz
Super User III
Super User III

HI @dsab81 ,

What are the Items of the ComboBox (or more to the point, what is the valid output of xxxx in ComboBoxName.Selected.xxxx? If as an example is was EmailAddress, the DefaultSelectedItems would be

{EmailAddress:User().Email}

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

 

dsab81
Microsoft
Microsoft

When i query 'ComboBox-To'.SelectedItems , it should display the User Record . But what i get is empty table as i mentioned in my original post. It doesnt pick the value from the default selected items.

 

So when i send email using the send button (formulae) , it doesn't send email to the user as it find the value in the default selected item to be empty. 

Office365Outlook_1.SendEmailV2( Concat(

'ComboBox-To'.SelectedItems,

Mail& ";" )

 

Here is the 'items' : 

Microsoft365Users.SearchUser({searchTerm: 'ComboBox-To'.SearchText})

 

and Data fields 

dsab81_0-1618244512258.png

 

SafaK
Helper I
Helper I

Yes, that is correct, because you are saying ('ComboBox-To'.SelectedItems), where in the default case the item was not selected manually, therefore the value will be blank, so what you can do as a work around, you can set the selected value in a variable, and declare a this variable onVisible property for the screen, which means : 
1. go to screen OnVisible property, decalre new variable with the default value, 

SafaK_0-1618247966532.png


2. go to the Selected Default item in the comboBox and set it to the variable value,

SafaK_1-1618248026069.png

 

 

3. Onchange property for the comboBox change the value for the same variable 

SafaK_2-1618248064592.png



4. Use the variable value to send email ,

SafaK_3-1618248106043.png



This should work now 🙂 

 

View solution in original post

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 (1,888)