web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Autofill/Auto-select a...
Power Apps
Answered

Autofill/Auto-select a dropdown value based on a text field

(0) ShareShare
ReportReport
Posted on by 1,712

Hello,

I have a dropdown that holds the employee's ID concatenated with their display names, and a text field that populates the employee's ID's based on a dropdown that also populates the current user signed-in.
Capture8.PNG

What I am trying to achieve is the following:

Once the ID is populated let's say "1000", I want the dropdown to look for this ID and auto select/populate directly the employee ID + Employee Name.

 

The Items property of the dropdown is below:

AddColumns('Employees Information',"EmployeeInformation",Concatenate('Employee Number',"-",'Direct Reporting Line Name'))

The Employee ID text field is dependant on another dropdown that populates the current user signed in as I mentioned above:

LookUp('Employees Information', 'Employee Name'.DisplayName = DataCardValue2.Selected.DisplayName, 'Employee Number')

I have tried to set the default selected items of the dropdown as below:

{EmployeeInformation:Concatenate(DataCardValue1.Text," - ",DataCardValue2.Selected.DisplayName)}

The above function pulls the data returned from the fields, concat both fields and add the above value to the dropdown but it's not a good solution, because I want to auto-select the value without creating new value in the dropdown based on the employee ID that means if I clicked on the dropdown directly it takes me to the value selected.

Is it possible to achieve the above scenario?

Can please someone explains in detail and provide an example?

Any help will be greatly appreciated.
Thank you!

Categories:
  • Vijay Tailor Profile Picture
    2,961 on at

    @Julien2 ,

    As I understood from the below, Yo needs to Set the Default selected value for DropDown/Combox.

    Please see the approach for Set default selected value for DropDown and Combobox.

    See the below code for Set the Default Selected value for Combo box.

    [Concatenate(TextInput2.Text,"-",TextInput3.Text)]

    VijayTailor_0-1601131538743.png

    See the below code for Set the default value for DropDown.

    Concatenate(TextInput2.Text,"-",TextInput3.Text)

    VijayTailor_1-1601131623877.png

    Thanks,
    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."

     

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Julien2 :

    Could you tell me:

    • What is the "dropdown"?According to your screenshot, it looks like a combo box control.I assume it is  a combo box.
    • Do you want this combo box control to automatically select the corresponding option based on  DataCardValue1.Text and DataCardValue2.Selected.DisplayName?

    If my guess is correct,the default option of this combobox will be a new item.Becaus 

    {EmployeeInformation:Concatenate(DataCardValue1.Text," - ",DataCardValue2.Selected.DisplayName)}

    is not a recrod in 

    AddColumns('Employees Information',"EmployeeInformation",Concatenate('Employee Number',"-",'Direct Reporting Line Name'))

    If you want to find the corresponding record in the data source of the combo box, I suggest you use this code:

    LookUp(
     AddColumns('Employees Information',"EmployeeInformation",Concatenate('Employee Number',"-",'Direct Reporting Line Name')),
     EmployeeInformation=Concatenate(LookUp('Employees Information', 'Employee Name'.DisplayName = DataCardValue2.Selected.DisplayName, 'Employee Number')," - ",DataCardValue2.Selected.DisplayName)
    )

    or

    LookUp(
     AddColumns('Employees Information',"EmployeeInformation",Concatenate('Employee Number',"-",'Direct Reporting Line Name')),
     EmployeeInformation=Concatenate(DataCardValue1.Text," - ",DataCardValue2.Selected.DisplayName) )

    Best Regards,

    Bof

  • EBMRay Profile Picture
    1,712 on at

    Hello @v-bofeng-msft ,

    Thanks for your reply.

    Yes, it is a combo box.

    I have followed what you mentioned and I have set and tried both functions on the default selected items property. But unfortunately, the first lookup is not returning a record and it displays "We didn't find any data", whereas the second lookup it returns the correct result based on what's selected.
    Due to the first lookup message, still, nothing was selected in the combo box.
    Please have a look at the below screenshots:

    Capture12.PNGCapture13.PNG

    Any clue why it's not working?

    Looking forward to your response.
    Regards,
    Julien

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Julien2:

    I think the only reason that can cause this problem is that there is no record in the data table(Addcolumns(……)) that meets the condition (helpercolumnname=‘100-AmericanDouri’)

    In your screenshot, the employee corresponding to number 1000 seems to be "Admin"?

    Best Regards,

    Bof

  • EBMRay Profile Picture
    1,712 on at

    Hello @v-bofeng-msft ,

    Thanks for your quick reply.

    That's right, it was not matching with the same data. Now it's working, but for some reason, if the name was on the upper case "AMERICANDOURI" and the display name is "AmericanDouri" it will not return data/record.

    Capture14.PNG

    How could I handle this issue?

    Looking forward to your response.
    Regards,
    Julien

  • Verified answer
    Vijay Tailor Profile Picture
    2,961 on at
    You can use Lower(Text) function for Both end then your Issue will reslove.
  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Julien2 :

    I agree with @VijayTailor ,Please try this code:

    LookUp(
     AddColumns('Employees Information',"EmployeeInformation",Concatenate('Employee Number',"-",'Direct Reporting Line Name')),
     Lower(EmployeeInformation)=Lower(Concatenate(DataCardValue1.Text," - ",DataCardValue2.Selected.DisplayName))
     )

    Best Regards,

    Bof

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 221 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 120

Last 30 days Overall leaderboard