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?

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

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.

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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (4,823)