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

Check box controller for Single line text

Hi,

i am working on app that required check box instead of text input on edit screen  . if i checked check box it should write in text input  "PH". If i uncheck it should remove "PH". if previously "PH" is there, when i open edit form check box should be checked by default because of "PH"  was There.

 

Please help me how can i achieve this .
thank you  

2 REPLIES 2
BCLS776
Super User
Super User

Try some code like this in the Default property of the text input:

If(
    CheckBox1.Value,
    "PH",
    ""
)

In the OnCheck and OnUncheck properties of the check box put:

Reset(inputText1); // Reset the input text control

Hope that helps,

Bryan

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.
v-qiaqi-msft
Community Support
Community Support

Hi @ursNani,

Could you please tell me that if you want to populate the TextInput based on the Checkbox value?

Could you please share a bit more about your scenario?

 

I assume that you want to populate the TextInput with "PH" if you tick the Checkbox, and leave it with blank if you uncheck the Checkbox, all this will only be operated in a New Form. However, if you edit an existing record, once you open the edit form, the Checkbox should also be checked based on the "PH" value.

 

If so, I think you should try as below.

1). Set the Default property of the TextInput as below:

If(IsBlank(ThisItem.Title),If(Checkbox2.Value,"PH",""),ThisItem.Title)// Title is the column I need to populate with the "PH"

2). Set the Default property of the Checkbox as below:

If(!IsBlank(ThisItem.Title)&&ThisItem.Title="PH",true,false)
Best Regards,
Qi

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,655)