cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

If statement syntax issue

Hi guys I have a question about my syntax issue I’m having. I have a formula with an if statement saying if all my toggles are true, my supervisor check on my excel query is true, but can not finish the final statement. Cause if not all of the toggles are true then the check is false. My statement looks something like && windowstoggle.value=true (“true”)(“false”)}), “”) and on the first bracket infront of (“true”) it says unexpected characters and I can’t fix it
10 REPLIES 10
Drrickryp
Super User
Super User

Hi @Thefournier351

Please post your formula.

Ok but wont put every toggle it’s like 15 minutes of writing lol Its in the studio can’t paste
PreStartStatus: If(AirfilterToggle.Value=false Or BatteryToggle.Value=false, “Shift”, If(ThreePointContactToggle.Value=false, “Plan”, “True”)), SupervisorCheck: If(AirfilterToggle.Value=true && BatteryToggle.Value=true (“true”),(“false”)}), “”)
My mistake is at the final line where true and false are right after each other

OK, I see one problem with  your formula off the bat.

If(AirfilterToggle.Value=true && BatteryToggle.Value=true (“true”),(“false”)}), “”)

There is a right curly bracket that probably shouldn't be there since there is no left curly bracket shown.  Also there appears to be a missing comma between the If() function condition (Airfilter.Toggle.Value=true) and the result of the condition when the condition is true.  The syntax for the If() function is:  If( Condition1, ThenResult1 [, Condition2, ThenResult2, ... [ , DefaultResult ] ] )

 If(AirfilterToggle.Value=true && BatteryToggle.Value=true, “true” , “false”)


I believe my restatement of your formula says that if both toggle values are true, then the return value "true" will be put somewhere and if either of the toggles is not true, then return value "false" will be put in the same location.  Since the two options are mutually exclusive, therre would be no need for a default result so "") is eliminated.  Maybe I'm missing something but If this is not correct, let me know.

 

 

Issue1.pngplease find my attached new issue. the bottom part was indeed fixed.

 the bottom of the formula is now fixed but the top now has an invalid argument

this is the part which has now been fixed for the most part except one highlighted sectionthis is the part which has now been fixed for the most part except one highlighted section

3rd issue right at bottom3rd issue right at bottom

My browser doesn't let me follow the If() statement beyond what is shown in the box.  Could you please isolate the offending statement with the error and repost it. 

BTW, my process for debugging formulas is to isolate each phrase and test if it works, then start connecting them.  

issuepart1issuepart1issuepart2issuepart2issuepart3issuepart3issuepart4issuepart4issuepart5issuepart5

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

Check out the New Ideas Site

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

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