cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ttieum
Level: Power Up

How to set a default value in Edit Form for a SharePoint lookup field ?

Hi, I am trying to define a PowerApps Edit Form to create a new item in a SharePoint List having a lookup field.

 

When I autogenerate the form, a dropdown list is created for this column. What I want to do is to set a default value for this field, because in my business logic, I already know the value for this new object. But it seems hard to achieve. I have tried to set the default value of the automatic dropdown (named DataCardValue(N)) with a lookup. The default value is correctly set but then the item can't be recorded. Error message says a value is needed or the value is incorrect.

 

Please could you tell me how to set the default value for the SharePoint lookup field ? Thanks.

4 REPLIES 4
Community Support Team
Community Support Team

Re: How to set a default value in Edit Form for a SharePoint lookup field ?

Hi ttieum,

 

The dropdown box for the lookup fields uses the data source stored under SharePoint, currently I can't find a way to filter that.

 

And also I tried to use the lookup function to filter the current SharePoint list, but this seems to be not working.

I will do some more tests, and if any helpful results found, will post back.

Regards

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Microsoft stlocate
Microsoft

Re: How to set a default value in Edit Form for a SharePoint lookup field ?

Hi, any update about this? I have the same problem.

Thank you
EdHacker
Level: Powered On

Re: How to set a default value in Edit Form for a SharePoint lookup field ?

See  https://community.powerapps.com/t5/PowerApps-Forum/How-to-patch-a-SharePoint-Lookup-Column/td-p/2409... 

 

You create the same type of record explained above.  Then set your new record to the default field.

tomkcook
Level: Power Up

Re: How to set a default value in Edit Form for a SharePoint lookup field ?

This doesn't work for me.  When I set the default for a lookup like this:

 

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

then I get the default value filled in in the combobox in the app preview but when I open the app through Dynamics365, the combobox remains empty.

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Kudoed Authors (Last 30 Days)
Users online (6,009)