Skip to main content

Notifications

Community site session details

Community site session details

Session Id : JqtO9WwpVuSh4S2p6WoIep
Power Apps - Building Power Apps
Answered

Setting Default Value in a SharePoint Table Lookup

Like (0) ShareShare
ReportReport
Posted on 24 Dec 2020 15:06:23 by 40

Hi Community

 

I was following this guide on how to set default values for table lookup fields from SharePoint: Defining default values for complex SharePoint types in forms | Microsoft Power Apps (this post here Solved: How to set a pre-populated default value of a Drop... - Power Platform Community (microsoft.com) proposes similar code).

 

My code for the Default property looks like:

 

LookUp(Choices(Expenses.Status);Id = 1)

 

 

Unfortunately, the dropdown stays empty when opening this edit form... Is there something special, I should pay attention to?

 

Thanks

Categories:
  • Verified answer
    Schwerzmann Profile Picture
    40 on 04 Jan 2021 at 17:41:35
    Re: Setting Default Value in a SharePoint Table Lookup

    Hi community

    After struggling quite a few times, finally, the issue got found. It's driving me crazy, but if you are working with Dropdown-fields, you must go with the "DefaultSelectedItems" property and not using the (also existing) "Default" property...
    All the magic suddenly works, once taking the right property...
    Have a nice evening

  • Schwerzmann Profile Picture
    40 on 28 Dec 2020 at 17:07:22
    Re: Setting Default Value in a SharePoint Table Lookup

    Hi @mdevaney and @Anonymous 

     

    Thanks for your answers. I was testing all of your proposals and some others too. I'm still struggling to get a value entered at all into this SharePoint LookUp Columns or better said the dropdown representing this lookup column.

     

    Maybe some additional information: I'm having an EditForm connected to a SharePoint List with DataCards connected to columns of this SharePoint List. When leaving the Dropdown as it's created by Power Apps, I can easily choose an entry of the Status List (which is source of the Lookup Column). But I can't set one of these entries in the Status List as a default value.

     

    Here some data:

    SharePoint List "Expenses" has multiple columns. One of these columns is a lookup column to the SharePoint List "Status", it is looking up the Title Column of "Status".

    Now, when adding an entry to the "Expense" list, the dropdown representing the lookup Column for "Status" should automatically choose the "Title"-Value of the "Status"-List entry with value 1 in the ID-Column.

     

    Is this feasible?

     

    Thanks

  • mdevaney Profile Picture
    29,987 Super User 2025 Season 1 on 24 Dec 2020 at 15:43:24
    Re: Setting Default Value in a SharePoint Table Lookup

    @Schwerzmann 
    Setting the Default value for a LookUp column can be accomplished like this.

     

    {
     Id: 1,
     Value: LookUp(Expenses, Id=1, Status) 
    }

     

     


    Do not make a lookup to a choices column. Change status to a text column instead.  Choices columns just make things complicated here.

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

  • Community Power Platform Member Profile Picture
    on 24 Dec 2020 at 15:31:05
    Re: Setting Default Value in a SharePoint Table Lookup

    Hello @Schwerzmann ,

    I think choices always uses Value so you need to use something like : 

    LookUp(Choices(Expenses.Status),Value = 1)

    Don't forget the comma instead of semi comma

     

    Reagrds,

    Akram 

     

    ------------------------------------------------------------------------------

    If this helped you, please consider giving it kudos and accept it as a solution. Thanks 

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 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,731 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,079 Most Valuable Professional

Leaderboard
Loading started