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

default value in toggle button

How to see the toggle button value

RajSaha__0-1614052891387.png


Thanks,
Raj

 

1 ACCEPTED SOLUTION

Accepted Solutions
Helper II
Helper II

If(IsBlank(Parent.Default) Or Parent.Default = "Open", false, true)
this formula is working 
Thanks guys for your support 
@Drrickryp @AsanKani @mrleetyler @BlessedCobba 

View solution in original post

15 REPLIES 15
Super User II
Super User II

@RajSaha_ 

Toggles can either be true or false regardless of what is shown in the TrueText and FalseText properties of the control.   You can set the default as true or false. If the default property is empty it is interpreted by PowerApps as false. FYI, it is the same for the checkbox control.  To make them work in a form you need to do a simple formula

If(Parent.Default, "Open","Resolved")

Helper II
Helper II

I want show the value 
If its true then it will show Open or Resolved

RajSaha__0-1614054390109.png

 

 

let me know explain little more... what is your requirement?

Super User II
Super User II

@RajSaha_ 

To make them work in a form you need to do a simple formula depending on whether you are saving true/false in your datasource or "Open"/"Resolved". 

If(Parent.Default, "Open","Resolved") resolves to if the Parent.Default is true, "Open","Resolved" if the datasource value is (true/false). 

Alternatively, if you are saving "Open" and "Resolved" in your datasource, then it would be If(Parent.Default="Open",true,false)

Helper I
Helper I

As Drrickryp said, you can only set true and falue values on a toggle.

You just need to modify your default code to this

 

If(IsBlank(Parent.Default) or Parent.Default = "Open", false, true)

 

 

Then set the FalseText to "Open" and the TrueText to "Resolved"

Helper II
Helper II

in the database value its showing Resolved 

RajSaha__0-1614055147321.png

But in the the application its showing open

RajSaha__1-1614055244051.png

I used the the above formula 

Helper II
Helper II

RajSaha__2-1614055436701.png

 

reverse the coding.. 

if(parent.default = "Open","Open","Resolved")

 

Parent.Default with no definition will look for boolean true/false

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.

Top Solution Authors
Top Kudoed Authors
Users online (63,559)