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
Frequent Visitor

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
Frequent Visitor

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

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

Top Solution Authors
Top Kudoed Authors
Users online (74,645)