Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Set Default Value for lookup field with Selected Gallery ID

(0) ShareShare
ReportReport
Posted on by 621

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 

 

  • ctedesco3307 Profile Picture
    621 on at
    Re: Set Default Value for lookup field with Selected Gallery ID

    @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

     

     

  • Verified answer
    JohnM86 Profile Picture
    590 on at
    Re: Set Default Value for lookup field with Selected Gallery ID

     

    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!

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard