cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
grandepaci
Regular Visitor

Saving a DefaultSelectedItem in a combobox

Dear PowerApps Community,

 

i have a form, where we create/edit new items in a sharepoint list.

One of the columns/comboboxes is called "Genehmiger" or approver, who is selected from a Office365Users connector.

My plan was to have our admin as a DefaultSelectedItem when creating a new item.

This User "Admin EAS" is showing up in the new form, by putting ["Admin EAS"] into DefaultSelectedItem.

 

grandepaci_0-1629231751755.png

 

Our problem is, after saving a new item, the "Admin EAS" user is not anymore selected on the column "Genehmiger" for this item.

Do you have a idea, where the problem lies?

 

Thanks in advance.

 

Sincerely

grandepaci

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@grandepaci 

What is the Update property of the datacard that contains this control? 

 

If the underlying column is a People column and if you are doing a lookup into Office365 users, you need to first convert the user from an Office 365 user record to a SharePoint user record in order to save it.

Then, the DefaultSelectedItems (DSI) property needs to reflect the Parent.Default as well.

 

So, in general - if your underlying column is a People column, your Update property should be:

With(yourComboxbox.Selected, 
{ 
   Claims:"i:0#.f|membership|" & Lower(Email), 
   Department:"", 
   DisplayName: DisplayName, 
   Email: Email, 
   JobTitle: "", 
   Picture: ""
}
)

 

So, is this a Person column or a Text column?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

5 REPLIES 5
CNT
Super User
Super User

@grandepaci "Admin EAS" is just a Text but rather the DefaultSelectedItems should have something of type User.

CNT
Super User
Super User

@grandepaci You can use this formula to find the Admin USer,

Office365Users.SearchUserV2({searchTerm:"Admin EAS"})

RandyHayes
Super User
Super User

@grandepaci 

What is the Update property of the datacard that contains this control? 

 

If the underlying column is a People column and if you are doing a lookup into Office365 users, you need to first convert the user from an Office 365 user record to a SharePoint user record in order to save it.

Then, the DefaultSelectedItems (DSI) property needs to reflect the Parent.Default as well.

 

So, in general - if your underlying column is a People column, your Update property should be:

With(yourComboxbox.Selected, 
{ 
   Claims:"i:0#.f|membership|" & Lower(Email), 
   Department:"", 
   DisplayName: DisplayName, 
   Email: Email, 
   JobTitle: "", 
   Picture: ""
}
)

 

So, is this a Person column or a Text column?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
grandepaci
Regular Visitor

Unfortunately, that didnt work. It blocked the function to search for anyone.

Wow, that actually did the trick. I removed the "& Lower(Email)" because it gave me an error.

 

Thank you so very much.

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Kudoed Authors
Users online (2,414)