cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Seperate string in three parts

Jump to solution

Hi folks, 

 

I have the task, to create a workflow solving the following problem:  I have several strings in a Multiple-Choice-Metadate, each of them starting with a pattern of numbers in the format 1.02.03 (so n.nn.nn). I must extract those numbers to three variables, so I have variable1=1, variable2=02, variable3=03.  Regular Expression is a part of the solution, i think, but I do not have any experiance in those regex.  Has anyone an idea, how to create a workflow in Nintex Workflow 2010 to solve this? 

 

Thanks

Labels: (1)
Tags (3)
0 Kudos
Reply
5 Replies
mlauer
Nintex Newbie

Re: Seperate string in three parts

Jump to solution

Hi Gabriel,

You can use the following regular expression:

^(\d)\.(\d\d)\.(\d\d).*$

I have attached a test workflow.

Kind regards

Manfred

0 Kudos
Reply
Not applicable

Re: Seperate string in three parts

Jump to solution

Thanks, but unfortunately i cannot import the test workflow as an websiteworkflow (I get an error message, telling me this)
Maybe you can explain, how to set up that regex-action?
I assume, i put the ^(\d)\.(\d\d)\.(\d\d).*$ in the pattern-field.

That checking "exctract"!?

There are three variables which should be filled accordingly
Does that happen in the same action?

Edit: I almost forgot: There are additional chars behind the given string. (ex. 1.02.03 Teststring)
Those chars are not needed in the variables. I only need the numbers.

0 Kudos
Reply
mlauer
Nintex Newbie

Re: Seperate string in three parts

Jump to solution

I've made the export mit Nintex Workflow 2013, what version do you use?

I will describe the workflow:

Workflow variables:

coll

CollectionNo

result

Single line of textNo

ind

NumberNo

variable1

Single line of textNo

variable2

Single line of textNo

variable3

Single line of textNo

Actions:

  • 1. Split text based on a regular expression and store result in coll, index in ind.

               Pattern: ^(\d)\.(\d\d)\.(\d\d).*$

               Operation: split

               input text: 1.02.03 xxxxxx

  • 2. Loop through each item in coll and store result in result.
  • 3. Run if Variable 'ind' equals '1'.
  • 4. Set variable variable1 to equal result.
  • 5. Run if Variable 'ind' equals '2'.
  • 6. Set variable variable2 to equal result.
  • 7. run if Variable 'ind' equals '3'.
  • 8. Set variable variable3 to equal result.
  • 9. Log a message to the workflow history list.

               variable1={WorkflowVariable:variable1}

               variable2={WorkflowVariable:variable2}

               variable3={WorkflowVariable:variable3}

0 Kudos
Reply
Not applicable

Re: Seperate string in three parts

Jump to solution

There is the clue ... 2010 is my version. Should be the reason, I can not import yours.


I created all six variables and the regex-action (though, i do not know, what you mean with "index in ind" ... ok .. I think I might know what you MEAN, but not how it is done

And then I am lost in the "loop"-thing.

The loop-action has no "for-each" trigger or something like that. Or do I have to use some other action?
Sorry, about all the newbish questions, but I am really new to this :/

If it it easier to explan, it might be helpful to switch to German, if you want to. If I interpret your profile right ....

0 Kudos
Reply
mlauer
Nintex Newbie

Re: Seperate string in three parts

Jump to solution

You have to use the 'For each' action, not the 'loop' action.

0 Kudos
Reply