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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Default in dropdown fr...
Power Apps
Answered

Default in dropdown from variable

(1) ShareShare
ReportReport
Posted on by 35
Hi,
I have a variable (varSite) that stores a site name based on a selected item from a Modern Table. I am then trying to set the default value of a form control based on the variable, but for some reason it does not display even though the variable contains the correct information. The Site Name dropdown does show all the site names from a Sharepoint Lookup, which works as it should. Can somebody please point me in the right direction to what I am doing wrong, I include screenshot below.
 
 
Many Thanks
Phil
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,117 Most Valuable Professional on at
    What is missing here is the Items of that Combo Box and the resulting output/DisplayFields. It is not .Value, using the actual field name displayed the DefaultSelectedItems should be
    {FieldName: varSite.Value}
    If it is .Value, your issue is that varSite contains other fields, so you need to be specific
    {Value: varSite.Value}
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    Visit my blog Practical Power Apps    LinkedIn   
  • WarrenBelz Profile Picture
    153,117 Most Valuable Professional on at
    A quick follow-up to see if you received the answer you were looking for or if you need further assistance.

    Please ✅Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    Visit my blog Practical Power Apps    LinkedIn   
    ​​​​​​
  • Phil2222 Profile Picture
    35 on at
    Thanks @ 
    I did manage to get this to work as per the below images. However, when I submit the form this column sometimes remains blank in my SharePoint list, although all other columns in the form save ok, this one, sometimes it does and sometimes it doesn't and I can't figure out why. It is meant to save back to a SharePoint Lookup column, is this the possible the problem.
     
     
     
    Thanks in advance 
    Phil
  • Verified answer
    WarrenBelz Profile Picture
    153,117 Most Valuable Professional on at
    A lookup column - that makes it even more complicated. These will generally cause you nothng more than unwanted and unnecessary complication- I never use them. The issue is that they are a complex field type and need to contain the ID of the record in the other list being looked up. Assuming for the moment that .Value is the output of the control, the DefaultSelectedItems should be
    {
       Value: varSite.Value,
       Id: LookUp(
          YourLookedUpListName,
          YourLookedUpFieldName = varSite.Value
       ).ID
    }
    Note the difference case of Id in the field and ID in the other list.
     
    Please ✅ Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like♥.
    Visit my blog Practical Power Apps    LinkedIn   
  • Phil2222 Profile Picture
    35 on at
    @WarrenBelz Thank you for your help, this is working as expected now.
    Just out of interest, how would you recommend dealing with the SharePoint Lookup field in future, or maybe I will even try it in this scenario.
     
    Thanks again
    Phil
  • WarrenBelz Profile Picture
    153,117 Most Valuable Professional on at
    A SharePoint Lookup column has very limited effective usage with Power Apps as SharePoint is not a Relational database and almost all "relationships" can be managed by Power Apps directly as it has access to all data sources involved. If you are only using it to access the "looked-up" field, use a Single Line of Text field in the "primary" List and get the options from the "looked-up" list in your drop-down directly from the second list.
    You will enhance Delegation management (you cannot delegably Sort by or use StartsWith on a Lookup column and they are much more complex to read from/write to).

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard