cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ShaneITAutomate
Post Patron
Post Patron

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

v-bofeng-msft
Community Support
Community Support

Hi @ShaneITAutomate :

Please set the combobox's DefaultSelectedItems property to:

{Result:User().FullName}

Best Regards,

Bof

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.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

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 (6,622)