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 / Dropdown based on ID f...
Power Apps
Answered

Dropdown based on ID field

(0) ShareShare
ReportReport
Posted on by 92

I'm not sure why I'm struggling with this so much but I'm trying to do a simple dropdown control based on an ID field stored in the datasource. In this case I have a "request" table and a "statuscode" table. The request table has a statusID field which is linked to the statuscode table. Let's say there are two values for status code, "1=Open, 2=Closed". I added the code below to the default property but it doesn't appear to work. I have a record that is closed but the dropdown shows open. 

 

This should be simple and something I will need to do often if I am going to work with database tables which often just store the ID of a foreign key instead of the display text. 

 

If(EditForm1.Mode = FormMode.New, LookUp(StatusTable, 1 = StatusID, Status), LookUp(StatusTable, Parent.Default = StatusID, Status))
powerapps_ddl_sample01.JPG
Categories:
  • Verified answer
    iotc Profile Picture
    43 on at

    Hi, this is how I do it with a combobox control called fkSex_dd

     

    dd.png

  • MattMcQ Profile Picture
    92 on at

    Turns out to be user error. My formula for the lookup on the default in the drop down was not using the ID field from the supporting table. I was using StatusID instead of StatusCodeID. Normally I would use the exact same name for the fields but I wonder if that is a good idea. If both tables had "StatusID" then how would the lookup know which to use? If I get the time I should try a test and see what happens. Looking at your example I assume that is partially why have a "fk" prefix on your main table when looking to store the ID from a foreign table.

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 350 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 318

#3
Mohsin Ali Profile Picture

Mohsin Ali 220

Last 30 days Overall leaderboard