I have a number of 2 choices fields in CDS. I am trying to create a powerapp that has toggles to switch these on and off. PowerApps inserts a dropdown as a default and will not allow me to switch to a toggle. I have deleted the dropdown and inserted a toggle and attempted to change the Update control of the datacard according to the below thread, but it doesn't seem to work.
The formula i have used in the Update Control is: If (ElectricyToggle.Value=true, 'T5 Electricity'('Take 5S').Yes,'T5 Electricity'('Take 5S').No)
Super appreciate any help!
Solved! Go to Solution.
Hi again @v-xida-msft I've tried that formula in the Update section. I am no longer getting an error, which is great! (not quite sure if it works yet), but now i am confused about the code you have recommended in the Default part of the Toggle itself. I'm not quite sure what that will do, and also, my Powerapps doesn't seem to like the formula as you can see below. Any thoughts?
Hi @Cym ,
Based on the screenshot that you mentioned, I found that you have a mistake with your operation. You should add the Toggle control within the T5 Electricity field data card rather than outside the T5 Electricity field data card in your Edit form.
Note: Please consider remove the Toggle control from your Edit form, then select the T5 Electricity field data card, then click "Insert"-> "Toggle" control, make sure the Toggle control is added within the T5 Electricity field data card rather than outside.
The ThisItem operator only works when you add the Toggle control within the T5 Electricity field data card. The formula I provided above within the Default property of the Toggle control is used to display proper Toggle status when you edit an existing record. If you do not apply the formula I provided above within the Default property of the Toggle control, the Toggle control would remain same default status regardless of whether or not you add or edit an record.
Check out the on demand sessions that are available now!
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Features releasing from October 2020 through March 2021
Check out the Power Platform Community Highlights