cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rohit4044041
Resolver I
Resolver I

Help with Nested If conditions

Hello

I have below Nested if conditions applied on a Combobox, which I feel is right. I still get sysntax error (IF has invalid arguments)

 

DefaultSelectedItems=

If(SharePointForm1.Mode = FormMode.New,If(DataCardValue17.Value = true || DataCardValue16.Value = true ,["No"],["NA"]),Parent.Default)

 

If I just put inner If condition, it works fine 

DefaultSelectedItems = If(DataCardValue17.Value = true || DataCardValue16.Value = true ,["No"],["NA"])

 

However, I want formula to run, only on NEWFORM and not edit. Any suggestions please?

1 ACCEPTED SOLUTION

Accepted Solutions
Rohit4044041
Resolver I
Resolver I

Never mind, seems there is diffrent way to set Combobox value with conditions. Below is correct sysntax

 

If(SharePointForm1.Mode = FormMode.New,If(DataCardValue17.Value = true || DataCardValue16.Value = true ,{ Value: "No" },{ Value: "NA" }),Parent.Default)

 

This article explains these scenarios better.

https://powerapps.microsoft.com/en-us/blog/default-values-for-complex-sharepoint-types/

View solution in original post

1 REPLY 1
Rohit4044041
Resolver I
Resolver I

Never mind, seems there is diffrent way to set Combobox value with conditions. Below is correct sysntax

 

If(SharePointForm1.Mode = FormMode.New,If(DataCardValue17.Value = true || DataCardValue16.Value = true ,{ Value: "No" },{ Value: "NA" }),Parent.Default)

 

This article explains these scenarios better.

https://powerapps.microsoft.com/en-us/blog/default-values-for-complex-sharepoint-types/

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,671)