web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / how to fix the error f...
Power Apps
Answered

how to fix the error for switch function

(0) ShareShare
ReportReport
Posted on by 675

Hi,

In the pic below,I am trying to use switch function(2) based upon the selection made in (1)

freshyshreya_0-1631515755397.png

Note:1 is a combo-box

2 is a label

The below pic shows the error

freshyshreya_1-1631515891825.png

Please help!

 

 

Categories:
I have the same question (0)
  • PriyankaGeethik Profile Picture
    3,320 Super User 2024 Season 1 on at

    Hi @freshyshreya ,

     

    Could you please share the code. It seems there is something wrong in the code and it is returning table values to the label.

     

  • freshyshreya Profile Picture
    675 on at

    Hi @PriyankaGeethik ,

    Sharing the code in the pic below.

    freshyshreya_0-1631517538730.png

     

  • PriyankaGeethik Profile Picture
    3,320 Super User 2024 Season 1 on at

    Hi @freshyshreya ,

     

    Do you want to display the text in square brackets ? 

  • Verified answer
    PriyankaGeethik Profile Picture
    3,320 Super User 2024 Season 1 on at

    Hi @freshyshreya ,

     

    If you want to print the values in text format you can use below formula and update according to your requirement. 

     

    Switch(ComboBox2.Selected.Value,"Finance",Concatenate("[","freshy","]"),.....)

     

     

    Please click Accept as solution 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 Thumbs Up.

  • freshyshreya Profile Picture
    675 on at

    Hi @PriyankaGeethik ,

    No,I don't want to display the text in square brackets.It should be normal text like freshy,rajesh,aravind etc

  • PriyankaGeethik Profile Picture
    3,320 Super User 2024 Season 1 on at

    Hi @freshyshreya ,

     

    In that case please try below formula because powerapps consider [ ] for array thats why it is resulting in records value. 

     

    Switch(ComboBox2.Selected.Value,"Finance","freshy",.....)

     

    Please click Accept as solution 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 Thumbs Up.

     

  • freshyshreya Profile Picture
    675 on at

    Hi @PriyankaGeethik ,

    The solution works.Thanks!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 834

#2
Valantis Profile Picture

Valantis 533

#3
Haque Profile Picture

Haque 410

Last 30 days Overall leaderboard