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 III
Super User III

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 III
Super User III

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

eka24
Super User III
Super User III

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (44,896)