4

I have the below string stored in a variable:

11608,613,12,12643,12644,12656

I want to extract each value before the comma and perform a set of actions.

How to extract each value from the string using SPD 2013 workflow?

0

3 Answers 3

6

This requires a couple of string actions.

  1. Find the index of "," in a string
  2. copy the string from index 0 to the index position of ","
  3. loop until you find the ","

See below working sample. You need to replace ";" with "," in your case

enter image description here

4
  • I dont see "Copy from" action in my SPD 2013 workflow.
    – George
    May 23, 2017 at 14:20
  • 1
    The action is "Extract Substring of string from Index of length" May 23, 2017 at 15:11
  • 1
    I confirm this works. Just to note, additional action is required before loop to set WF variable pendingStepsExist to Yes. After this modification WF worked as charm.
    – Danilo
    Nov 2, 2017 at 13:40
  • this is awesome! works perfectly to parse an array of id's. so simple too. i've been looking for something like this for awhile.
    – Ice Cube
    Aug 13, 2020 at 23:48
1

Plumsail Actions Pack contains free strings actions, so you can use Split String action to do this, see an example below: SharePoint Workflow Designer Split string

PS: I want to notice that this is paid product and I'm one of the developers, but you can use String Processing set for free.

0

I stored 11608,613,12,12643,12644,12656 in a workflow string variable and updated it to a hidden text column in the list.

Then using 2 SharePoint calculated columns, i took each value before the first comma.Then using workflow loop, I updated Calc Column 2 value into the hidden text column till the calc column 2 became empty.

Calc Column 1 formula -

=IF(ISERROR(LEFT([HiddenTextColumn],INT(FIND(",",[HiddenTextColumn])-1))),[HiddenTextColumn],LEFT([HiddenTextColumn],INT(FIND(",",[HiddenTextColumn])-1)))

Calc column 2 formula -

=IF(ISERROR(RIGHT([HiddenTextColumn],LEN([HiddenTextColumn])-INT(FIND(",",[HiddenTextColumn])))),"HiddenTextColumn",RIGHT([HiddenTextColumn],LEN([HiddenTextColumn])-INT(FIND(",",[HiddenTextColumn]))))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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