cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nliu
Helper II
Helper II

Switch function

Hello,

 

I would like to use a switch function in my datasource property in my form. But it seems like the form is not connected to any of my SP List. Do you know why and how can I fix it ?

 

Note : all my SP List has the same columns/structure

 

Thank you, 

 

Switch.jpg

 

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @nliu ,

Your syntax looks OK, but I cannot check the validity of your Variable.

I just did a quick test using the same logic and got the same result as you until the Variable was set to one of the choices.

Once I did that, all was well.

Note that in Design mode, Variables quite often reset.

Try putting a label the the variable, set it and then check if it is one of your choices.

 

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.

 

View solution in original post

5 REPLIES 5
WarrenBelz
Super User
Super User

Hi @nliu ,

Your syntax looks OK, but I cannot check the validity of your Variable.

I just did a quick test using the same logic and got the same result as you until the Variable was set to one of the choices.

Once I did that, all was well.

Note that in Design mode, Variables quite often reset.

Try putting a label the the variable, set it and then check if it is one of your choices.

 

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.

 

eka24
Super User
Super User

Insert a dropdown and put in the items property:

["DT","DTECA","DTECE"] Add all other list of items you have.
 
Then in the Datasource of the form :
Switch(Dropdown5.SelectedText.Value,
"DTECA",ZA_Hardard_List,
"DT", ZA_Cost)
 
Change ZA_Hardard_List,ZA_Cost to your datasoucrces. Also add all other datasources.
 

If you like this reply, please give kudos. And if this solves your problem,
please accept this reply as the solution.

 

 

@eka24 @WarrenBelz 

 

Thank you both for your answers, here a screen where my variable "myTarget" is set :

 

Set(myTarget; "DTEXXX") is set on each button. But yes I try to click on one of this button and the form appears and the data was connected to right datasource. So as long as you don't choose on which datasource you are working with, the data will no longer be connected to the form.

 

Menu.jpg

Hi @nliu ,

Are you saying it is working as designed or do you have another question?

 

If working, please consider accepting either or both of the proposed solutions.

Yes it is working as designed 🙂

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (3,073)