You are viewing limited content. For full access, please sign in.

Question

Question

How to update the 1st value in multi-value field

asked on October 4, 2018

Hi All,

I am working on creating a approval process where i need to assign different values to a multi-value field through workflow.

There are only 3 values in assign Field value activity. 

1) Append to existing values.

2) Replace existing values.

3) Clear all values. 

 

 

Is there a way I can Replace a particular value (say 1st value) ?

 

Please suggest. Thanks in advance. 

0 0

Replies

replied on October 4, 2018

Updating multivalue fields can be a bit tricky when you want to change a specific value in the collection. You could try the following:

  1. Create a new empty multivalue token in your workflow (something like NewValues)
  2. Retrieve the multivalue field (set it to All Values)
  3. Iterate the values using a for each value (under Values select the YourToken_All value from the retrieve field values activity)
  4. Add a two-branch condition
    1. If ForEach_Iteration = Your target value
      • Append the new value to %(NewValues)
    2. Else,
      • Append the %(ForEach_CurrentValue)
  5. Add a Set Field Values, and Replace the current values with the %(NewValues) token

 

What this does is build a new list of values, in the same order, that only replaces the target value. Then, that new list overwrites the old list allowing you to change a specific value.

You may need to account for the unexpected, for example, if the process is trying to update the 4th value but there are only 3 current values.

0 0
replied on October 7, 2018

Hi Jason,

Thanks a lot. This is working.. 

 

Kind Regards

Rajah

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.