cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
F_Quint
Helper IV
Helper IV

Populate user name as Defaultselecteditems value for Combobox - Expected table values

I have a Sharepoint list field that is set to 'People or Group' and I'd like to auto-populate the comboBox in my Power App with the DisplayName of the current user. 

 

I have a variable _myProfile that creates a record for each user but it cannot set the defaultselectedItems value for my Combobox, is there another way to accomplish this?

 

Navia_calendar.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@F_Quint 

If this is a ComboBox, then you will want to set the DefaultSelectedItems property not the Default.

In your DefaultSelectedItems, place the following formula (assuming that your _myProfile has an email address as well):

 With({profile:Office365Users.MyProfile()},

    {Claims: "i:0#.f|membership|" & profile.Mail, 
     Department: profile.Department, 
     DisplayName: profile.DisplayName,
     Email: profile.Mail,
     JobTitle: profile.JobTitle,
     Picture: "."
    }
)

Make sure you have AllowSearching on.

 

I hope this is helpful for you.

_____________________________________________________________________________________
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

3 REPLIES 3
RandyHayes
Super User
Super User

@F_Quint 

If this is a ComboBox, then you will want to set the DefaultSelectedItems property not the Default.

In your DefaultSelectedItems, place the following formula (assuming that your _myProfile has an email address as well):

 With({profile:Office365Users.MyProfile()},

    {Claims: "i:0#.f|membership|" & profile.Mail, 
     Department: profile.Department, 
     DisplayName: profile.DisplayName,
     Email: profile.Mail,
     JobTitle: profile.JobTitle,
     Picture: "."
    }
)

Make sure you have AllowSearching on.

 

I hope this is helpful for you.

_____________________________________________________________________________________
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!

@F_Quint 

I would recommend you follow the advice of @RandyHayes.  But I would also like to point out that you have placed your code inside the Default property and not the DefaultSelectedItems property as mentioned within your title.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

@RandyHayes  Works great! Thank you so much!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,015)