Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a workflow that automatically updates the value of a multi-valued field in an item. This workflow is working as expected. BUT, when that field/column of an item has a value already, the current value gets replaced when i update its value.... What i merely want is adding an item to that multi-value column/field without replacing its current value...

To make things specific, Column name: Attached Files (Multi-valued, Links to the Source Name of the File) Lets say this specific item has file named "file1.doc" value to Attached Files column, Then i want to update this column with a new document named file2.doc... i want the result of Attached File column for this item to be links to "file1.doc" and "file.doc"

EDIT: Thanks andrey for your input. Regarding the getting of previous data, im having trouble on this one... On its simplest form, I tried to set the value of Attached Files column to its own value before i add the current item value for debugging purposes coz if i directly jump to "current + new item" addition i got an error that's why i made it simple first but still i got an error... How can i add the new item to the current value if setting it to its current value gives me an error already? Im expecting that this would just be fine since i'm merely overwriting the current value with its current value :). Am i right?

Thank you!

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

Usually if you want to add value into multivalue field in SharePoint Designer, you should set value to the existing value plus the new value.

This involves conversion of the field value to string and then from string, so you must be aware of how sharepoint stores multivalue column internally, which is something like this:

id1;#value1;#id2;#value2;#id3;#value3

(so the separator is ;#, and each item is represented by id and value)

So you need to provide your own value after the existing value. Here is how you can do it in SharePoint Designer:

enter image description here

Instead of ;<put your new value here> you should use for example something like this:

;#5;#file5

I used this approach several times in real world projects and it works quite well.

P.S. Please don't forget to check if the current value is empty, in this case obviously you should use your current code.

share|improve this answer
    
hi andrey, thanks a lot for your answer but i can't see the image on how to do it in SPD. Is the value dynamic? Or does it need to be unique? What happens if the value of the id is the same? –  JYR Feb 12 '13 at 5:24
    
Well, i just want to see the image on how to do it :) –  JYR Feb 12 '13 at 5:47
    
sorry but I provided exactly the image of how to do it in SPD in my answer (i.stack.imgur.com/tusqn.png). can you see it? –  Andrey Markeev Feb 12 '13 at 10:59
    
IDK why but for almost 8hours of trying different things, setting up different return types and all more or less the same stuffs.... ALAS! i made it work! Actually i followed what you've said andrey but still i just don't know what's the exact settings just to make it work... but i guess ur the lucky charm!!! Thanks a lot dude! –  JYR Feb 12 '13 at 12:40
    
You're welcome :) –  Andrey Markeev Feb 12 '13 at 12:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.