cancel
Showing results for 
Search instead for 
Did you mean: 
apatel
Nintex Newbie

How to use condition for workflow variable

I have a scenario in shich I am storing substring for an Item value in workflow variable and I need to check if the value is DP001. please find below screens and let me know. 

 

 

I uused following function to get 3 to 7 characters from string 

fn-Substring((fn-Length(DocID)-fn-Length(DocID-2)),5)

 

I am begineer for Nintex please let me know any solutions.

Thanks in advance...

Set_variable.PNGcheck)if_contains_DP001.PNG

 

Labels: (1)
0 Kudos
Reply
3 Replies
Automation Master
Automation Master

Re: How to use condition for workflow variable

first of all, check the correct syntax of inline functions  you miss a source string in Substring() function

https://help.nintex.com/en-US/nintex2013/help/#Workflow/RootCategory/Designer/Nintex.Workflow.Inline...

 

the second, arithmetical operation are not evaluated in place for inline functions. you need to prepare all the arguments upfront.

so if (eg) lenght of DocID is 10 your formula

fn-Length(DocID)-fn-Length(DocID-2)

evaluates literally to

10-12

note the second expression will evaluate to "12" because of lenght of string "1234567890-2"

 

 

if you always need to get substring always starting at the same possition and of the same length. haven't you tought of using regular expression?

the regex pattern might look like

 

(?<=^.{2}).{5}

i.jpg

0 Kudos
Reply
apatel
Nintex Newbie

Re: How to use condition for workflow variable

yes you are right. than how can I get characters from 3 to 7 from string.

0 Kudos
Reply
Automation Master
Automation Master

Re: How to use condition for workflow variable

don't you like suggested approach with regular expression?

IMHO it's easiest/cleanest way...

0 Kudos
Reply