cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Srinath
Level: Powered On

Disabling existing text in a textbox and the new text user adds should be appended with existing disabled text

Hi,

 

I'm currently facing a scenario where i have a textbox for 'action taken', i want the text that the user has previously entered to be disabled, but the user should be able to add new comments here and when he clicks on the save button this text should be appended with the disabled text. This should happen each and everytime. I use sharepoint online list as backend.

 

Any help will be greatly appreciated

 

Thanking you in advance,

Srinath

2 REPLIES 2
Microsoft RusselThomas
Microsoft

Re: Disabling existing text in a textbox and the new text user adds should be appended with existing disabled text

Hi @Srinath ,

There are a couple of ways you can do this, mostly only different based on the user experience you want to create.

If you're using a form* to submit data, then the Update: property of the card that contains the field you're updating is what you want to focus on.  I would NOT recommend using SharePoint version history enabled with a comments field because the entire history of comments are not easy to get to - so a muli-line text column should be sufficient.

Simply put, set the Update: property of the field in question to 

ThisItem.ActionTaken & " <comments separator> " & DataCardValueWhatever.Text

How you display this to the user is where the user experience comes in.  For me, it makes sense to show them the current comments as View only, then give them an input to append comments.  You can do this with an extra card, or in the same card, it's really up to you - I'll use the same card as the example and assume the field/column name is "ActionTaken".  (Please note the difference between editing card properties and editing control properties inside the card.  Also take note of the name of the text input control inside the current card - in a form it's likely to be DataCardValue-something)

  • Unlock the ActionTaken card and add a data label control to it - give it a name like lblCurrentActions.
  • Set the data label control  Text: property to ThisItem.ActionTaken
  • Set the Default: property of the card to "" (2xdouble quotes)
  • Set the Update: property of the card to ThisItem.ActionTaken & "<comments separator>" & DataCardValue-something.Text

You're going to want to separate your comments with something like a ; or anything that is unlikely to appear in the actual comments, so just replace <comments separator> with whatever character or phrase you will want to split it out with later.

*Using something other than a form - like a Patch() statement - the principles are the same - avoid populating the input control with the existing values and make sure you update the record with "existing value & separator & new value".

Hope this helps,

RT

Srinath
Level: Powered On

Re: Disabling existing text in a textbox and the new text user adds should be appended with existing disabled text

Hi @RusselThomas 

 

Thanks for the reply. I will try it out.

 

Thanks & Regards

Srinath

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,966)