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

Re: Ability to set a default value for a Sharepoint Choice field mapped to DataCard in a PowerApps F

The above suggestion won't work for combo box or data card default property. Pls place the code in default.selected.item . it will work. work for me  in a new form

sully12
Level: Powered On

Re: Ability to set a default value for a Sharepoint Choice field mapped to DataCard in a PowerApps F

NA

Beat
Level 8

Re: Ability to set a default value for a Sharepoint Choice field mapped to DataCard in a PowerApps F

Putting the code into the DefaultSelectedItems property rather than Default is key. You made my day @wnzn, Thanks.

etherjack
Level: Powered On

Re: Ability to set a default value for a Sharepoint Choice field mapped to DataCard in a PowerApps F

My code:

If(SharePointForm1.Mode = "New",{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Id:0,Value:"N/A"},ThisItem.MyColumn)

For some reason PA keeps throwing a warning (not an error) when trying to check the current form mode. I get an adorable little green squiggly under the equal sign between .Mode and "New".

 

The warning message is:

"Incompatible type. We can't evaluate your formula because the values being compared in the formula aren’t the same type. The left value is a Enum type and the right value is a Text type."

 

Since this is a warning and not an error...maybe this is expected behavior? Little help?

etherjack
Level: Powered On

Re: Ability to set a default value for a Sharepoint Choice field mapped to DataCard in a PowerApps F

Gah! I knew I would figure it out as soon as I posted the questions. :\

 

For some reason (which I am too tired to care about right now), it worked only after I replaced this:

 

SharePointForm1.Mode = "New"

...with this:

 

SharePointForm1.Mode = FormMode.New
Dannyboy
Level: Powered On

Re: Ability to set a default value for a Sharepoint Choice field mapped to DataCard in a PowerApps F

It works perfectly for me! Thanks a lot!

image.png

DroningOn
Level: Powered On

Re: Ability to set a default value for a Sharepoint Choice field mapped to DataCard in a PowerApps F

Hoping someone can help me with my issue, 

Using a Sharepoint column set to Choice and Checkboxes (allow multiple selections) for the datasource

When I use the recommended solution it throws the error "The 'if' fuction has some invalid arguments" pointing to the else part of the if statement. ThisItem.Department_x0020_Training_x0020_throws the error "invalid argument type (table) expecting a record value instead"

If(SharePointForm1.Mode = New, {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Id:0,
Value:"Determined by Department Manager"},
ThisItem.Department_x0020_Training_x0020_)

DroningOn
Level: Powered On

Re: Ability to set a default value for a Sharepoint Choice field mapped to DataCard in a PowerApps F

Any one running into my issue above it is solved by simply not including an else condition

If(SharePointForm1.Mode = New, {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Id:0,
Value:"Determined by Department Manager"})