Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

Maximum Switch statements

(0) ShareShare
ReportReport
Posted on by 1,257

Is there a maximum number of items you can have in a switch statement?  Looks like I might have approx 25 is this too many? does it affect performance?

Categories:
  • CNT Profile Picture
    CNT 10,919 on at
    Re: Maximum Switch statements

    @vffdd Let me know if you need any help to redesign!

  • vffdd Profile Picture
    vffdd 1,257 on at
    Re: Maximum Switch statements

    Yeah you are right ! I need to have a think about it myself to see if a more efficient way 🙂 I'll come back to you as will prob need suggestions but going to work on it myself first.. thanks I'll leave this open for the moment if that's ok

  • zmorek Profile Picture
    zmorek 3,272 on at
    Re: Maximum Switch statements

    I agree with @CNT , perhaps there's a better way to do it? Care to share some specifics and maybe we can help?

  • CNT Profile Picture
    CNT 10,919 on at
    Re: Maximum Switch statements

    @vffdd The documentation does not specify any limit. Also there no performance issues because only one branch of the Switch is going to be executed. But....

    ...having 25 branches doesn't seem very good design let alone maintainability of the code!

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,508

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,839

Leaderboard