cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ShaneITAutomate
Helper V
Helper V

Dropdown of user names (from different list) display user() as first option

Hi,

 

I have an app where the users select there name from a dropdown, they can also select other users (in this case visitors or guests).

 

I get all the names from a online sharepoint list called EmployeeNamesList using the following code on start function

 

If(
    Connection.Connected,
    ClearCollect(
        colNames,
        {Name: ""}
    );
    Collect(
        colNames,
        ShowColumns(
            EmployeeNamesList,
            "Name",
            "EmploymentStatusType"
        )    
    )
)
;

 

I then use the following code on a dropdown

 

SortByColumns(Distinct(colNames, Name),"Result")

 

However i would like the users to have their own name displayed as default whilst also having all the other names below if they need to sign someone onto the system that doesnt have an account.

 

Is it possible?

 

 

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
eka24
Super User
Super User

On the DefaultSelectedItems  Change formula to:

{Value:LookUp(colNames,Name = User().FullName,Name)}

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Consider Checking My Youtube Channel

View solution in original post

v-bofeng-msft
Community Support
Community Support

Hi @ShaneITAutomate :

Please set the combobox's DefaultSelectedItems property to:

{Result:User().FullName}

Best Regards,

Bof

View solution in original post

6 REPLIES 6
eka24
Super User
Super User

In the Default of the Dropdown:

LookUp(colNames,Name = User().FullName,Name)

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Consider Checking My Youtube Channel

 

Thanks but it doesnt work i get the error "Expected Record Value"

 

The list im grabing from is just a text column filled with names First Last, its not connected to a person column

eka24
Super User
Super User

is it a Dropdown or a Combobox?

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Consider Checking My Youtube Channel

 

Combobox

eka24
Super User
Super User

On the DefaultSelectedItems  Change formula to:

{Value:LookUp(colNames,Name = User().FullName,Name)}

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Consider Checking My Youtube Channel

View solution in original post

v-bofeng-msft
Community Support
Community Support

Hi @ShaneITAutomate :

Please set the combobox's DefaultSelectedItems property to:

{Result:User().FullName}

Best Regards,

Bof

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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