cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
digiservice
Advocate II
Advocate II

Switch no longer working in 3.19111.26

I have a gallery with icons that have their visibility set using a Switch function and rules.

 

I know that rules are being depreceated but these don't seem to be the root of the issue

 

Something like this:

 

ico_cross : Visibility :

Switch(
ThisItem.Screen,
FormPage1, If( rule_FormPage1 = true, false, true ),
FormPage2, If( rule_FormPage2 = true, false, true ),
FormPage3, If( rule_FormPage3 = true, false, true )
)

This works fine in the currently published version which is using 3.19104.33.


I went to edit the app today and noticed that the Switch is no longer working this is using releasr 3.19111.26.

 

I removed the rules and replaced them with a test condition as so:

 

ico_cross : Visibility :


Switch(
ThisItem.Screen,
FormPage1, If(1+1=2  = true, false, true ),
FormPage2, If(1+1=2  = true, false, true ),
FormPage3, If(1+1=2  = true, false, true )
)

Still the switch did not work.

I changed the Switch to and Or with nested If statements as follows:

Or(
If(ThisItem.Screen = FormPage1, If(rule_FormPage1 = true, true, false)),
If(ThisItem.Screen = FormPage2, If(rule_FormPage2= true,true,false)),
If(ThisItem.Screen = FormPage3, If(rule_FormPage3= true,true,false))
)

And this works, correctly.

 

Has something happened to the Switch function?

 

7 REPLIES 7
digiservice
Advocate II
Advocate II

I've created a test in a new app and can replicate this. Please see the attached screenshots.

 

This seems to be specifically a problem with using "screen"

Hi, my app is having the exact same issue since the new PowerApps release. I'm glad someone else found the common root cause.

I was using a series of conditions that determined what the next screen would be, and using a switch statement to navigate to the screen. This has stopped working and I've been going crazy trying to fix this.

Would love to have a MS response to this. 

Hi @EdwardAhn  and @digiservice ,

Do you mean that you can not use Switch function about Screen?

I've made a similar test but not met the same problem.

I set the gallery's arrow button's OnSelect:

Switch(ThisItem.Name,"abc",Navigate(Screen1),"aaa",Navigate(Screen3))

 It will navigate to screen correctly.

Here's my PowerApps version: 3.19111.28

 

I suggest you clear your browser's cache, update to the latest version, try this again by using the latest version of PowerApps.

If the problem still exists, I suggest you ask for help here:

https://powerapps.microsoft.com/en-us/support/pro/ticket/

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yutliu-msft thanks for your response, but this bug is present when the switch statement happens on the screen control. In your example you have the switch on ThisItem.Name.

 

If you look at @digiservice's switchfunction.png screenshot, you can see how you can replicate this error. I've replicated this myself on a simple test app.

 

Thanks

 

Edit: FYI current PowerApps release for my test app = 3.19111.33

 

Hey folks, I created an app that demonstrates the problem + the If workaround, and submitted a ticket (case 119111723000225).

 

I also noticed another issue related to this - if you store the screen control as a global variable and browse the Variables tab to see its current value, it appears with blank details.

@digiservice @EdwardAhn Thanks for reporting this issue. Currently If can be used as workaround for issue that you are facing, I will update here once issue with Switch is resolved.

FYI for others who may be encountering issues. There is another bug related to using screen controls in operator statements:

DOES NOT WORK

ScreenVariable in [‘Screen1’,’Screen2’,’Screen3’]

 

WORKS

Or(ScreenVariable = ‘Screen1’,ScreenVariable = ’Screen2’,ScreenVaraible = ’Screen3’)

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (77,664)