cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Set combo box default item to the current user

Hi all,

 

I have another question. On the home screen of one of my apps the users search for and select themselves so they can record data about what work they're doing throughout the day.

 

The combo box is a standalone input field, so not part of a form. The items property is: Filter(Office365Users.SearchUser({searchTerm: Self.SearchText}), Department = "Corporate Resources, IBC").

 

I cannot figure out what piece of code to put in the DefaultSelectedItems property of the combo box.

 

I think it needs to be something like this(?): Filter(Office365Users.SearchUser({searchTerm: Self.SearchText}), Mail = User().Email).

 

The screen looks like this: 

freddiejoseph1_0-1615201967462.png

 

I have seen lots of posts about doing this using sharepoint as a datasource, but not the O365 Users connector.

 

Thanks,

 

Freddie

 

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

You're very close! This will work to default select the current user:

 

First(Office365Users.SearchUserV2({searchTerm:User().Email}).value)

View solution in original post

4 REPLIES 4
JR-BejeweledOne
Super User
Super User

You said:

I think it needs to be something like this(?): Filter(Office365Users.SearchUser({searchTerm: Self.SearchText}), Mail = User().Email).

 

Have you tried this?



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.
timl
Super User
Super User

Hi @Anonymous 

You might find that just setting the DefaultSelectedItems property to this will work.

[User().Email]

 

Anonymous
Not applicable

You're very close! This will work to default select the current user:

 

First(Office365Users.SearchUserV2({searchTerm:User().Email}).value)
Anonymous
Not applicable

Thanks. This works perfectly!

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (2,193)