Skip to main content

Notifications

Power Apps - Building Power Apps
Suggested answer

Switch Formula not working

Posted on 2 Dec 2024 14:37:16 by 11
Hi,
 
I'm trying to use a switch formula -  I have 12 programmes in a list that translates into a button when selected , I then need the button to navigate to the seperate main page:
 
 
 
I've started the below formula but its not working:
 
OnSelect
 
 
Switch(
Self.Text,
"Cancer",
Navigate(CancerMainScrn),
"Diagnostics",
Navigate(DiagnosticsMainScrn)
  • WarrenBelz Profile Picture
    WarrenBelz 143,595 on 15 Dec 2024 at 04:39:15
    Switch Formula not working
    A quick follow-up to see if you received the answer you were looking for or if you need further assistance.

    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    Buy me a coffee
  • WarrenBelz Profile Picture
    WarrenBelz 143,595 on 02 Dec 2024 at 21:08:23
    Switch Formula not working
    You maybe missing a closing bracket - it should work on the button OnSelect reading the Text property, which I assume is conditional.
    Switch(
       Self.Text,
       "Cancer",
       Navigate(CancerMainScrn),
       "Diagnostics",
       Navigate(DiagnosticsMainScrn)
    )
     
  • Suggested answer
    ronaldwalcott Profile Picture
    ronaldwalcott 1,203 on 02 Dec 2024 at 15:52:56
    Switch Formula not working
    Is that a dropdown? What is the source of the data items? To know which item is selected you would normally start with something like nameDropdown.Selected then the evaluation changes depending on the data source. Could be nameDropdown.Selected.Value or instead of value might be a column name

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,595

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,098

Leaderboard