Nintex Connect

The Official Community Site for Nintex Software Products, including Nintex Workflow 2007, 2010 and 2013; Nintex Workflow for Project Server 2010; Nintex Reporting 2008 and Nintex Analytics 2010; Nintex Forms 2010; Nintex Live and Nintex SmartLibrary.
Welcome to Nintex Connect Sign in | Join | Help
in Search

Inline Functions

Last post 04-24-2010, 2:55 AM by Vadim_Tabakman. 11 replies.
Sort Posts: Previous Next
  •  05-26-2009, 10:49 PM 4099

    Inline Functions

    Hi,

    How to use inline functions in Nintex and where are the different functions available? I coundn't able to find anything in the help file or in SDK.

    Regards,

    Bidhan

  •  05-27-2009, 5:13 PM 4119 in reply to 4099

    Re: Inline Functions

    This information is in the Help Files in the section "Using the Workflow Designer > Inline functions".  Here it is as well:

    In any text input that supports inserting references, an inline function can be entered that will evaluate when the workflow runs.

    Functions can also be used as arguments for other functions.

    Function behavior
    The parsing engine first replaces any inserted reference tokens, and then the resulting text is evaluated for functions. If a function contains another function as an argument, the inner most function will be evaluated first. As reference tokens are replaced first, the reference token can also contain function syntax that will be evaluated. If text contains function syntax (i.e. a brace or comma character) but is not intended to be interpreted by the parser, wrap the text with {TextStart} and {TextEnd} markers to inform the parser that the block should only be treated as text and not evaluated. For example, if a number variable that contains a decimal value is passed to the function, and the decimal separator for your region is a comma, the {TextStart} and {TextEnd} tokens will need to be used.

    Function reference
    fn-Abs
    Returns the absolute value of a number.

    Example

    fn-Abs({WorkflowVariable:Number})

    Arguments

    Number The number to return the absolute value of.

    fn-Currency
    Represents a numeric value as a currency formatted text.

    Example

    fn-Currency({WorkflowVariable:Cost})

    Arguments

    Number A variable containing a numeric value.

    fn-DateDiffDays
    Determines the number of days between two dates.

    Example

    fn-DateDiffDays({WorkflowVariable:StartDate}, {WorkflowVariable:EndDate})

    Arguments

    Start date The starting date and time to calculate the difference between.
    End date The end date and time to calculate the difference between.

    fn-DateDiffHours
    Determines the number of hours between two dates.

    Example

    fn-DateDiffHours({WorkflowVariable:StartDate}, {WorkflowVariable:EndDate})

    Arguments

    Start date The starting date and time to calculate the difference between.
    End date The end and time date to calculate the difference between.

    fn-DateDiffMinutes
    Determines the number of minutes between two dates.

    Example

    fn-DateDiffMinutes({WorkflowVariable:StartDate}, {WorkflowVariable:EndDate})

    Arguments

    Start date The starting date and time to calculate the difference between.
    End date The end and time date to calculate the difference between.

    fn-DateDiffSeconds
    Determines the number of seconds between two dates.

    Example

    fn-DateDiffSeconds({WorkflowVariable:StartDate}, {WorkflowVariable:EndDate})

    Arguments

    Start date The starting date and time to calculate the difference between.
    End date The end and time date to calculate the difference between.

    fn-FormatDate
    Represents a date time value in text of a specific format.

    Example

    fn-FormatDate({WorkflowVariable:MyDate}, d)

    Arguments

    Date A variable containing a date value.
    Format string Text describing how the date time value should be formatted. Information on how to format the value can be found on this page: Standard Date and Time Format Strings and this page Custom Date and Time Format Strings.

    fn-Insert
    Adds text in to a larger string.

    Example

    fn-Insert({WorkflowVariable:Text}, 4, {ItemProperty:Title})

    Arguments

    Text The text to modify.
    Start position The character position to insert the new text at. The first character in the string is at position 0.
    New text The additional text that will be added at the start position.

    fn-Length
    Returns the number of characters in a string.

    Example

    fn-Length({WorkflowVariable:Text})

    Arguments

    Text The string to count the characters of.

    fn-Max
    Returns the greater of two numbers.

    Example

    fn-Max({WorkflowVariable:Number1}, {WorkflowVariable:Number2})

    Arguments

    Number 1 The first number to compare.
    Number 2 The second number to compare.

    fn-Min
    Returns the lesser of two numbers.

    Example

    fn-Min({WorkflowVariable:Number1}, {WorkflowVariable:Number2})

    Arguments

    Number 1 The first number to compare.
    Number 2 The second number to compare.

    fn-NewGuid
    Generate a globally unique identifier.

    Example

    fn-NewGuid()

    fn-PadLeft
    Returns the provided string right aligned and padded to the total length with a specific character.

    Example

    fn-PadLeft({WorkflowVariable:Text}, 6)

    fn-PadLeft({WorkflowVariable:Text}, 6,-)

    Arguments

    Text The string to pad.
    Length The target total length of the padded result.
    Character Optional. The character to pad the original string with. A space character is used by default.

    fn-PadRight
    Returns the provided string left aligned and padded to the total length with a specific character.

    Example

    fn-PadRight({WorkflowVariable:Text}, 6)

    fn-PadRight({WorkflowVariable:Text}, 6,-)

    Arguments

    Text The string to pad.
    Length The target total length of the padded result.
    Character Optional. The character to pad the original string with. A space character is used by default.

    fn-Power
    Raises a number to the specified power.

    Example

    fn-Power({WorkflowVariable:Number}, {WorkflowVariable:Power})

    Arguments

    Number The number to raise to the power.
    Number The power to raise number to.

    fn-Remove
    Removes a section of text in a larger string.

    Example

    fn-Remove({WorkflowVariable:Text},xxx,{ItemProperty:Title})

    Arguments

    Text The text to modify.
    Start position The character position from which to remove the following characters. The first character in the string is at position 0.
    Length Optional. The number of characters from the start position to remove. All remaining characters will be removed by default.

    fn-Replace
    Replaces a section of text in a larger string.

    Example

    fn-Replace({WorkflowVariable:Text},xxx,{ItemProperty:Title})

    Arguments

    Text The text to modify.
    Old value The text to search for and replace.
    New value The text to replace Old value with.

    fn-Round
    Rounds a decimal value to the nearest integer.

    Example

    fn-Round({WorkflowVariable:Number})

    Arguments

    Number The decimal number to round.

    fn-SubString
    Extracts a portion of text from a string.

    Example

    fn-SubString({WorkflowVariable:Text},5,10)

    Arguments

    Text The text to extract a value from
    Start index The position in the text of the first character to retrieve. The first character in the string is at position 0.
    Number of characters The number of characters to retrieve from the start index.

    fn-ToLower
    Formats text in a string to all lower case.

    Example

    fn-ToLower({WorkflowVariable:Text})

    Arguments

    Text The string to convert to all lower case.

    fn-ToTitleCase
    Formats text in a string to title case.

    Example

    fn-ToTitleCase({WorkflowVariable:Text})

    Arguments

    Text The string to convert to title case.

    fn-ToUpper
    Formats text in a string to all upper case.

    Example

    fn-ToUpper({WorkflowVariable:Text})

    Arguments

    Text The string to convert to all upper case.

    fn-Trim
    Removes leading and trailing whitespace from a string.

    Example

    fn-Trim({WorkflowVariable:Text})

    Arguments

    Text The text to remove leading and trailing whitespace characters from.

    fn-XmlEncode
    Encodes a string to make it safe for viewing in html.

    Example

    fn-XmlEncode({WorkflowVariable:Text})

    Arguments

    Text The text to encode.

    fn-XmlDecode
    Decodes a html safe string to regular text.

    Example

    fn-XmlDecode({WorkflowVariable:Text})

    Arguments

    Text The text to decode.

  •  05-29-2009, 4:26 PM 4195 in reply to 4119

    Re: Inline Functions

    Thanks for this info.....will use these...but it's not coming in the help file.

    Can you give me the link to download the latest one.

    Regards,

    Bidhan

  •  05-29-2009, 4:44 PM 4197 in reply to 4195

    Re: Inline Functions

    I tried a different method the other day to try and ensure that the latest version would be avilable.  Please try this link again: http://connect.nintex.com/files/folders/nw_help/entry1549.aspx.
  •  06-01-2009, 10:00 PM 4239 in reply to 4197

    Re: Inline Functions

    Thanks for this link,

    The section of Inline Functions is added in the new help file,

    Regards,

    Bidhan

  •  07-03-2009, 11:40 PM 4892 in reply to 4099

    Re: Inline Functions

    Hi,

     I am having trouble nesting these functions. It looks much better than a regular expression.

    What I am trying to achieve is something like RIGHT(String, 3)

    I have come up with: fn-SubString({WorkflowVariable:Text},fn-Length({WorkflowVariable:Text})-3,fn-Length({WorkflowVariable:Text})) which is showing up in the history list as: fn-SubString(Authorized users 050,fn-Length(Authorized users 050)-3 ,fn-Length(Authorized users 050))

    I was expecting something like: "050" or " 05". What am I missing here?

     Kind regards,

    Dockum

  •  07-06-2009, 11:23 AM 4899 in reply to 4892

    Re: Inline Functions

    Hi,

    Looking at the SubString function:

    fn-SubString
    Extracts a portion of text from a string.

    Example

    fn-SubString({WorkflowVariable:Text},5,10)

    Arguments

    Text The text to extract a value from
    Start index The position in the text of the first character to retrieve. The first character in the string is at position 0.
    Number of characters The number of characters to retrieve from the start index.

    The function you are trying to execute would be invalid, it's trying to return more characters than possible.

    fn-SubString(testing,4,7) would not work because there is only 3 characters from the starting index of 4.

    a valid fn-SubString would be fn-SubString(testing,4,3).

    Below is a link to a small workflow you can import into any list, which has an example of a valid fn-SubString similar to the Right(string,x) function.

    http://download.nintex.com/Connect_images/4099wf1.zip

    Please note: This workflow is provided "as is", and while it's unlikely to cause any issues, Nintex cannot be held responsible for any that may occur.

  •  07-08-2009, 12:30 AM 4958 in reply to 4899

    Re: Inline Functions

    Thanks for the reply.

    I did try the workflow file, but in the history list it is still logging information like: fn-SubString(Authorized Users 175,16,3).

    I was expecting an entry like: '175' or ' 17'. I do think the function looks good, but I don't get the fact that there is no function resolution when logging this in the history list.

    Kind regards,

    Dockum

  •  07-08-2009, 1:41 PM 4972 in reply to 4958

    Re: Inline Functions

    Hi,

    I ran the exact same inline funtion fn-SubString(Authorized Users 175,16,3)  and recieved a result of '17'.

    Are you trying to use this inside a build dynamic string action?

    Also, can you please confirm you are running a Workflow build greater than 10903, inline functions were released in build 10903.

    There are two ways to determine which version and build of Nintex Workflow 2007 you have installed.

     

    The first is to navigate to any list or library in a site that has Nintex Workflow 2007 activated.  Then load the Workflow Designer by choosing to create a new workflow or by editing an existing workflow.  Open the configuration dialog for any workflow action and a build number will appear at the bottom left in grey text. The number is comprised of 5 digits, normally beginning with “108”.

     

    The other way to determine your version number is from within SharePoint Central Administration.  In Central Admin, click the “Application Management” tab, then scroll to the Nintex Workflow section and click the Licensing link.  The build number should be visible at the bottom of the licensing information that is displayed.

  •  07-13-2009, 10:12 PM 5052 in reply to 4972

    Re: Inline Functions

    Thank you for the swift reply... As a matter of fact: No, I was not running this function inside a build dynamic string action.. I was not aware of the fact that it will only function inside this action. Sorry about that.

    version number is 10902Q.

    But I think your first remark will do the trick :)

    Thank you!

  •  04-23-2010, 4:48 PM 10131 in reply to 4899

    Re: Inline Functions

    Hello Peter,

     Is there any way I can get the start position dynamically i.e. where the delimiter character is?

     EG 10 for the character \ in the string: Microsoft\hareshp

  •  04-24-2010, 2:55 AM 10146 in reply to 10131

    Re: Inline Functions

    Hi hpcdr,

    there isn't an inline function in that will give you the index of the delimiter.  One suggestion, would be to develop your own inline function to do this.

    The .Net String class has a IndexOf method, but it's not static, which is a requirement for an Inline Function in Nintex Workflow.  So all you'd need to do, is create a wrapper for it.

View as RSS news feed in XML
Powered by Community Server, by Telligent Systems