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 / Set Default Value for ...
Power Apps
Answered

Set Default Value for lookup field with Selected Gallery ID

(0) ShareShare
ReportReport
Posted on by 690

SharePoint column is a lookup column - New Form - Want to set the default value of the lookup field (ComboBox control) to be the value in the Gallery Selected ID 

Trying this 


{ID: galdcp.Selected.ID, Value:Value(galdcp.Selected.ID)} 


no error but no value 

If I change the control to a dropdown, and create a label with galdcp.Selected.ID as the text, then set the default to be the label.text it works .... but clearly not the best way to go  🙂    All help welcome - thx 

 

Categories:
I have the same question (0)
  • Verified answer
    JohnM86 Profile Picture
    590 on at

     

    To set the default value of a lookup field (ComboBox control) to be the value in the Gallery Selected ID, you can try the following:

    1. Make sure that the lookup column in SharePoint is set to allow multiple values if the ComboBox control allows multiple selections.

    2. Set the Items property of the ComboBox control to the list or library that the lookup column is connected to.

    3. Set the DefaultSelectedItems property of the ComboBox control to the following formula:

     

    { Value: galdcp.Selected.ID, '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference" }
     

    This formula sets the default value of the ComboBox control to the item with the ID that is selected in the Gallery.

    If you are still having issues, make sure that the value of the ID in the Gallery is the same data type as the ID column in the SharePoint list. Also, make sure that the gallery item is selected before the ComboBox control is loaded on the form.

    I hope this helps!

  • ctedesco3307 Profile Picture
    690 on at

    @JohnM86 One quick problem - When I submit the form the default values aren't updated in the columns. Is there one more thing I need to do? Thanks much! 

     

    ctedesco3307_1-1682024591963.png

     

     

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 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard