cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JoeChanUK
Regular Visitor

Validating toggle result

Hi there, 

 

I have an odd problem and I don't understand why it is happening, and hope someone can help me. 

 

I have a toggle on a form where if an user selects yes, it will go to one screen, otherwise it goes to another. However, this doesn't work. If I use the same method on the screen itself, i.e. not inside a form, it works fine. Why is that? 

 

OnSuccess: 

 

 

If(togReg.Value = true, 
    Navigate(scrInfo), 
    Navigate(scrSuccess)
)

 

 

Thanks.  

1 ACCEPTED SOLUTION

Accepted Solutions
JoeChanUK
Regular Visitor

Just to say this is no longer required. I re-created part of the form with the same controls etc and it works fine, so I can only assume something was corrupted. 

View solution in original post

3 REPLIES 3
WiZey
Super User
Super User

Hello @JoeChanUK ,

 

I once had a similar issue with this.

 

« Toggle.Value » returns a boolean value, and actually testing if it was equal to "true" gave me wrong results.

 

Could you try the code below please and see how it goes ?

 

If(togReg.Value, 
    Navigate(scrInfo), 
    Navigate(scrSuccess)
)

 

JoeChanUK
Regular Visitor

I'm afraid it comes back with an error if I do that... it will say incompatible type for comparison.

JoeChanUK
Regular Visitor

Just to say this is no longer required. I re-created part of the form with the same controls etc and it works fine, so I can only assume something was corrupted. 

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,741)