cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
freshyshreya
Post Patron
Post Patron

how to fix the error for switch function

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!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

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.

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

View solution in original post

7 REPLIES 7
PG_WorXz10
Community Champion
Community Champion

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.

 

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

Hi @PG_WorXz10 ,

Sharing the code in the pic below.

freshyshreya_0-1631517538730.png

 

Hi @freshyshreya ,

 

Do you want to display the text in square brackets ? 

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

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.

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

Hi @PG_WorXz10 ,

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

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.

 

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

Hi @PG_WorXz10 ,

The solution works.Thanks!

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (1,887)