Can update item of document library with append text?

%3CLINGO-SUB%20id%3D%22lingo-sub-1920434%22%20slang%3D%22en-US%22%3ECan%20update%20item%20of%20document%20library%20with%20append%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1920434%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BI%20want%20to%20update%20column%20of%20document%20library%20with%20append%20text%20and%20how%20can%20do%20it%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3Bexample%20%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BvarText%20is%20value%20from%20column%20'AcceptPerson'%20and%20I%20will%20get%20value%20before%20update.%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3Bbefore%20update%2C%20varText%20is%20%22%3CSTRONG%3EText1%3C%2FSTRONG%3E%22%20and%20varText%20is%20%22%3CSTRONG%3EText%201%20%2B%20AAA%3C%2FSTRONG%3E%22%20after%20update.%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EclientContext%20%3D%20new%20SP.ClientContext.get_current()%3B%3CBR%20%2F%3Evar%20oList%20%3D%20clientContext.get_web().get_lists().getByTitle(%22Test%20Documents%22)%3B%3CBR%20%2F%3Evar%20listItem%20%3D%20oList.getItemById(%2010%20)%20%3B%3C%2FP%3E%3CP%3ElistItem.set_item('AcceptPerson'%2C%20varText%20)%3B%3CBR%20%2F%3ElistItem.update()%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you.%3C%2FP%3E%3CP%3EAor.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1920434%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Contributor

Hi,

     I want to update column of document library with append text and how can do it?

     example :

           varText is value from column 'AcceptPerson' and I will get value before update.

           before update, varText is "Text1" and varText is "Text 1 + AAA" after update.       

 

clientContext = new SP.ClientContext.get_current();
var oList = clientContext.get_web().get_lists().getByTitle("Test Documents");
var listItem = oList.getItemById( 10 ) ;

listItem.set_item('AcceptPerson', varText );
listItem.update();

 

Thank you.

Aor.

0 Replies