cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Community Champion
Community Champion

Re: Switch function

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
Highlighted
Community Champion
Community Champion

Re: Switch function

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

Highlighted
Community Champion
Community Champion

Re: Switch function

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.

 

 

Highlighted
Helper II
Helper II

Re: Switch function

@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

Highlighted
Community Champion
Community Champion

Re: Switch function

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.

Highlighted
Helper II
Helper II

Re: Switch function

Yes it is working as designed 🙂

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,478)