cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Setting a Default value for a Choice List from Sharepoint gives Error

I am trying to set a particular field to Default to Active. It displays correctly, but upon submission gives the following error. Kindly assist.

 

Capture1.PNG

 

Error I get after populating the other mandatory fields and submittingCapture2.png

 

 

This is what it looks like when I change the default back to Parent.Default.

Capture3.png

 

Please point out where my error is and how to configure this differently, so that on the new form this field value is defaulted to "Active".

9 REPLIES 9
v-monli-msft
Community Support
Community Support

Hi @Anonymous,

 

May I know the column type of this SharePoint column that the dropdown control binded? Is it a Choice column type?

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi - its a Lookup field.

 

see also my post in response to a similar topic somone else raised...

https://powerusers.microsoft.com/t5/PowerApps-Forum/Set-Default-Value-for-Lookup-Field-in-New-Form/m...

 

Capture.PNG

You can do a simple "Active" in the default field and it will result in the dropdown always showing Active by default (as long as the word Active is in the list)

 

 

 

Hi @JRaasumaa

 

Can you elaborate on how to do this?  My question is simialr to OksanaBotha's, but my field is of type Choice.  I'm trying to push a default value back to SharePoint every time a record is saved from the app / form.  Where is the Dafault field located?

JRaasumaa
Memorable Member
Memorable Member

In the property field default it needs to say the default value in the dropdown list you want, surrouded by quotes, nothing more.

 

If you want the word Active to be default, and Active is in the dropdown, you would make the default property field for the dropdown say:

 

"Active"

 

That's all!

 

You can also populate this with a lookup and as long as the lookup value matches an item in the list it will show. This allows you to load data and show the value that's currently stored in the dropdown.

 

 

 

 

Great!!  Thanks for the swift response, @JRaasumaa

 

This results in the following error:

The property expects Record values, but this rule produces incompatible Text values

The value I am using is in the Choice list in SharePoint

 

Just to clarify your solution, in case I've misunderstood:  Go to the properties of the DataCard, then go to the Advanced tab.  Change the value in the Default field from "Parent.Default" to "Active" (or whaterver value is required).

JRaasumaa
Memorable Member
Memorable Member

Please see the below image using the default DropDownStample item list with "2" as the default instead of "1"

 

 

dropdowndefault.png

Thanks.  Sorry to take up so much of your time.

 

I understand where to put the value, but can't clear the error.  In your example, you're using a drop down control which is not linked to a data field.  My problem is that the value I'm entering as a default is creating some sort of validation issue between the field and the list.  As far as I can understand, it's due to a data type issue, rather than relating to the values.

JRaasumaa
Memorable Member
Memorable Member

Can you do a collection using Distinct to populate the dropdown?

 

Something like:

 

ClearCollect(DropDownValues,Distinct(SharepointListNameHere, Choice))

 

Then the Items value would be your collection DropDownValues.

 

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,466)