cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Toggle Control Behaviour on Edit Form

Hi All

Still fairly new to power apps and having an issue with the display properties of a toggle control.

 

Scenario - Once customer details have been added, flow sends an email to the customer in order to confirm address details and phone numbers are correct.  On receiving the reply email, flow changes the value of the sharepoint column to confirmed...

 

I have created a customer details app.  I have inserted a toggle control to display, when adding a new customer, (the Edit Customer Details screen is in "New" mode), the control is set to disabled, but once the value in Sp has been changed, the view details from gallery is correct, showing confirmed, but the Edit screen the toggle button is defaulting to Unconfirmed (false), so if the form is then resubmitted, it changes the value back to Unconfirmed. 

I need to have the user be able to toggle this to confirmed if the customer does not repsond to the initial email and details are confirmed telephonically.  but once confirmed, needs to stay and display true (confirmed)

I have tried this on default property

 

If(and(form2.DisplayMode = edit, ThisItem.Confirmed = true), Toggle2.Value = true, Toggle2.Value = false))

 

Getting this error

Incompatible type.  We can't evaluate your formula because the values being compared in the formula aren't the same type

 

I have also tried leaving the default property blank and with just "" but no luck, advanced properties default still shows false

 

Is there anyway to set the default to gallery.selected parent value

 

Thanks in advance

 

 

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User III
Super User III

Hi @samhudek ,

This needs to go on the Default of the Toggle

form2.DisplayMode = FormMode.Edit && ThisItem.Confirmed

so if both of those statements are true (there is no need to state =true on a Boolean value such as Confirmed), the toggle value will be true, otherwise it will be false.

 

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

Frequent Visitor

Thanks @WarrenBelz 

 

For anybody reading this thread - TextInput1.Text = ThisItem.Confirmed sorted the problem

View solution in original post

6 REPLIES 6
Super User III
Super User III

Hi @samhudek ,

This needs to go on the Default of the Toggle

form2.DisplayMode = FormMode.Edit && ThisItem.Confirmed

so if both of those statements are true (there is no need to state =true on a Boolean value such as Confirmed), the toggle value will be true, otherwise it will be false.

 

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

Hi Warren

Thanks for the speedy response.  I have tried that along with a couple of variations but still getting the same error

samhudek_0-1609557212805.png

samhudek_1-1609557246032.pngsamhudek_2-1609557264476.png

 All 3 as well as my first attempts still giving this error

samhudek_3-1609557312157.png

 

 

Hi @samhudek ,

Took me a while to spot it (also dangers of free-typing instead of testing on a model) - it needs to be (the full code)

Form2.Mode=FormMode.Edit && ThisItem.Confirmed

I have tested it here on a Form on a test list and got the results I expected.

 

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.

Frequent Visitor

Hi Warren

My apologies, it is like that, if you click out of the formula box, power apps displays the formula in that shortened way

samhudek_0-1609561265790.png

If it works on your test, made me think it might be something else in my app that could be causing this

 

Display mode for the toggle control was set to this

samhudek_1-1609561325830.png

 

Changed this to  the card Display Mode which was set to Parent.DisplayMode

 

Thought that had worked but it didn't (my apologies, marked as solution)

As a newbie, had set a textinput to visible off (note to self to leave doing that till last)

 

Hopefully this will clear things up a bit more...  I didn't know how to link the toggle directly to the field so made this work around with a textinput

samhudek_0-1609562906817.png

I have now modified the formula to this

samhudek_1-1609562958765.png

 

Need to link the default of toggle now to the text input

samhudek_2-1609562992015.png

 

 

 

 

 

 

 

 

Frequent Visitor

Thanks @WarrenBelz 

 

For anybody reading this thread - TextInput1.Text = ThisItem.Confirmed sorted the problem

View solution in original post

Hi @samhudek ,
Sorry accidentally marked your question as solution (buttons are beside each other) - what you are saying is the Confirmed is a Text field, not a Yes/No? In this case the Default would be

Form2.Mode=FormMode.Edit && ThisItem.Confirmed = "Confirmed"

 

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.

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

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

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (70,913)