gbaker88
Nintex Newbie

Re: How to combine multiple "like" items into one item

Jump to solution

Yeah, I don't think it was turned on, and unfortunately don't have the power to make that decision. I'll go ahead and keep trying with splitting the workflows, thanks again.

-Greg

Reply
cju
Automation Master

Re: How to combine multiple "like" items into one item

Jump to solution

no problem

Good luck

Reply
Not applicable

Re: How to combine multiple "like" items into one item

Jump to solution

Hi Greg Baker​,

did you solve this issue..

thanks

0 Kudos
Reply
gbaker88
Nintex Newbie

Re: How to combine multiple "like" items into one item

Jump to solution

Hi Ajay - yes I was able to modify my workflow to combine all collections from the beginning and align them in one variable per grouping.

-Greg

0 Kudos
Reply
Not applicable

Re: How to combine multiple "like" items into one item

Jump to solution

Hi Greg Baker​,

That's Great,

if it is possible could you share .nwf, that will be very helpfull.

Thanks,

0 Kudos
Reply
gbaker88
Nintex Newbie

Re: How to combine multiple "like" items into one item

Jump to solution

I can share the steps

1- Created separate Reg expressions to get the different string values.

2 - Created a For Each for each field and stored the results in a string

     A) Collection Operation below each For Each to add the previous strings to a Combined Collection

3 - Created another For each to store result in a separate string combined element, with a number combined index

     A) Reg Expression to Parse the string variable on the : and use the string combined element and input text with a new variable (string parsing having the results stored in it

     B) Collection Operation (3 of them - 1 for each, excluding hours) to pull apart the string based on the :. Created an Index with default values (programming looks at this as 0 being first occurrence, 1 being second, 2 being third and so on. Stored the result in a new variable for each

     C) Concatenated my two strings where I was looking for common values and stored result in a Combined String COMP_Role

     D) Collection operation to get hours (similar as above)

          a) Reg Expression (\d+(?= Hours)) to extract hours out and store results in collection

          b) Collection operation to store hours into a string

     E) Col Op to see if my target collection Exists within string, store answer in Yes/No variable

     F) Condition to see if Yes/No value is yes or no. If No, Collection operation to add all previous collections from step B). If Yes, created another yes/no variable and set to no. Created loop counter which is then set to 0

     G) Still within the Yes side I created another For Each that is storing the Collection into another variable (with the appropriate index selected). Have it set to stop processing when my original yes/no in step F) is true.

     H) Set Condition - If any value from workflow data from new looping string equals original string. No, moves on. Yes, set loop values again.

     I) Set loop counter variables to 1

     J) 3 Collection Ops to Get all values from original collection (3 separate collections), with an index (indexes are key to ensure the right value is pulled in) and store result in string.

     K) Add hours from new string created in J) to original hours value - store in another num collection

     L) Remove previous entry from hours collection, with index setup

     M) Put sum of hours back in hours collection - Original Collection for hours Add to num collection from K) - Have index setup accordingly

     N) Concatenate the Solutions, between two collections created earlier and store result in concat solution string.

     O) Put Concat Solution back into solution counter (same concept as row M))

4) Set another variable "Create item counter" to 0

5) Create another For Each

     A) For each Collection store result in a string variable

     B) Col Opt to get a piece of that string by using an index (Create Item Counter - step 4) variable and store in a Create variable

     C) Since I have everything separated besides the COMP_ROLE I need to create a Regex to split at the : and store in a new variable

     D) Create 3 more COL Operations for each individual piece of the string and index according and store in new create variables

     E) For any field that requires the items to be combined rather than joined you'll need to Replace the text. Mine were separated by a comma initially and SharePoint would treat that as one giant string and I want multiple strings (so it would appear in a choice field as being different selections). To do this use replace text and put in ;# into the replacement text and store result in another create item

     F) Create Item in new list.

Hope that helps!

-Greg

View solution in original post

Reply