cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper V
Helper V

Drop-down default for a lookup

If I have a lookup field with SharePoint as the Data connnection and I want the default drop down for this to "ABC" how would I do that?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Helper V
Helper V

Re: Drop-down default for a lookup

I was getting error when I used EditForm.Mode so I used If(DisplayMode.Edit= New instead. The issue now is that it says I am trying to compair Text with a Number.

View solution in original post

4 REPLIES 4
Highlighted
Super User
Super User

Re: Drop-down default for a lookup

I am assuming the SharePoint column is a lookup column and ABC is a value in the list that is referenced in the lookup. Lets say the lookup field is called LookupField and the "ABC" in the lookup has an item ID of 3. Then the PowerApps dropdown probably has a default property of ThisItem.LookupField. What you want to do is change it to the formula below.

 

If(EditForm.Mode = New, {
	'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
	Id:3,
	Value:"ABC"}, 
ThisItem.LookupField)

 This formula sets the default property to ABC which has an item id of 3 and it only sets the ABC default if it is a new form.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Highlighted
Helper V
Helper V

Re: Drop-down default for a lookup

I was getting error when I used EditForm.Mode so I used If(DisplayMode.Edit= New instead. The issue now is that it says I am trying to compair Text with a Number.

View solution in original post

Highlighted
Super User
Super User

Re: Drop-down default for a lookup

EditForm was the name of the form control on my test app. You just need to change it to the name of your form control.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Highlighted
Helper V
Helper V

Re: Drop-down default for a lookup

lol, got it. Thanks for the help Jeff.

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (9,027)