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

This formula has side effects and cannot be evaluated

So there is one hit on Google about this which is the topic in this forum:

https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/Delete-a-record-in-Azure-SQL-data-t...

But it really doesn't address what this error means nor how it applies to my issue.

 

    My problem:

I've got a global boolean variable var_toggle which is defined:


Set(
    var_toggle,
    false
)       = This formula has side effects and cannot be evaluated (Result when highlighted)

And it does this with load screen's OnVisible - once you are past that load screen you can't navigate back to it, so you can't hit that Set() again. When I insert a label with var_toggle in it's .text attribute, it gives me a result - false. The variable is also defined (false) in the File > Variables > Global section as well. Given the 'side effects' error it's a bit weird but the next part could be the real concern.

Then this variable goes on to define the visibility of objects on certain screens; pressing a button to makes the objects appear/disappear as such:

 

Switch(
    var_toggle,
    true,
    Set(
        var_toggle,
        false
    ),
    false,
    Set(
        var_toggle,
        true
    )
)      = This formula has side effects and cannot be evaluated (Result when highlighted)

 

So the initial declaration works fine even though it is said to have side effects BUT the button that switches between true and false doesn't work at all. This issue behaves exactly the same if I change the switch results to UpdateContext().

I am certain these are the only two place where this variable is Set/Updated. It is otherwise only used in object.visible. This method was working the other day and the only change I made was moving the initial Set() to the load screen.

Any ideas? This is murdering my sanity.

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Literally just renamed the variable and then back to the original name. Lord knows.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Literally just renamed the variable and then back to the original name. Lord knows.

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,930)