cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
msmith
Level 8

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
msmith
Level 8

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
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.
msmith
Level 8

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

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.
msmith
Level 8

Re: Drop-down default for a lookup

lol, got it. Thanks for the help Jeff.

Helpful resources

Announcements
thirdimage

Power Automate 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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,395)