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

Append text to a datafield

Hi, currently I'm trying to append the text "inactive" to an already existing data field (which is from a sharepoint list) upon the OnCheck feature of a checkbox, and removing the said text from the data field when the text box is unchecked. Is something like this currently possible in powerapps? 

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft
Microsoft

Hi afjm,

 

Sounds simple enough, but often with these things "simple" is a relative term 🙂

For example - for a simple view text label it's pretty easy - but for an input text control - a lot more complicated.

  

Can you provide some more details of your example, maybe a screenshot or two?

 

Basically my approach would be to variabilise the checkbox value and append it to your data value.

Like I said though, this can become really complicated really quickly depending on what you're trying to do - and there may be better ways of doing it, so the more detail you can provide about the ultimate goal here, the better.

 

To get you going, try this;

 

Set the OnCheck property of the checkbox to

UpdateContext({checkBoxValue: " - inactive"})

Set the OnUnCheck property to

UpdateContext({checkBoxValue: ""})

Add a text label and set it's Text property to

"text data" & checkBoxValue

 

If you toggle the checkbox you should see the text label now flip between "text data" and "text data - inactive"

 

Like I said though, this gets more complicated if you want users to edit "text data" - and also if you want to recall whether the checkbox has been ticked for saved data - so if this doesn't get you what you need, then some more detail would help 🙂

 

Kind regards,


RT

View solution in original post

1 REPLY 1
Microsoft
Microsoft

Hi afjm,

 

Sounds simple enough, but often with these things "simple" is a relative term 🙂

For example - for a simple view text label it's pretty easy - but for an input text control - a lot more complicated.

  

Can you provide some more details of your example, maybe a screenshot or two?

 

Basically my approach would be to variabilise the checkbox value and append it to your data value.

Like I said though, this can become really complicated really quickly depending on what you're trying to do - and there may be better ways of doing it, so the more detail you can provide about the ultimate goal here, the better.

 

To get you going, try this;

 

Set the OnCheck property of the checkbox to

UpdateContext({checkBoxValue: " - inactive"})

Set the OnUnCheck property to

UpdateContext({checkBoxValue: ""})

Add a text label and set it's Text property to

"text data" & checkBoxValue

 

If you toggle the checkbox you should see the text label now flip between "text data" and "text data - inactive"

 

Like I said though, this gets more complicated if you want users to edit "text data" - and also if you want to recall whether the checkbox has been ticked for saved data - so if this doesn't get you what you need, then some more detail would help 🙂

 

Kind regards,


RT

View solution in original post

Helpful resources

Announcements
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

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

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Kudoed Authors
Users online (68,690)