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

2 REPLIES 2
Anonymous
Not applicable

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

BeeBee
Advocate I
Advocate I

I have similar problem. But, I don't get what you mean in your provided solution.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

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