Workflows


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.

Advertisement

Active Directory groups can be used to manage access control within SharePoint but oftentimes, the required groups are not in existence and cannot easily be created. But there is a lot of relevant organizational information in Active Directory which could be used for the creation of access control within SharePoint. By combining the ability of Nintex workflows to query Active Directory using LDAP and the possibility of creating access control groups within SharePoint via web services, group creation and configuration can be automated to some degree.

In order to do this, you will need a SharePoint list which stores the parameters which will be used to lookup information from Active Directory.

In this example, the objective is to create country based access control groups, which are then made up of certain departments. As the nomenclature used in each country may vary, the list allows this information to be tailored in each case.

The overall shape of the workflow is as follows:

 

The first step is to delete the existing group and then recreate it, querying Active Directory in five parallel actions for the members of three core departments, in this case Finance, Legal and Tax, with the option of another department plus a non-department criterion if the information required does not fall into the standard departmental schema.

Each parallel action consists of the following steps:

The LDAP query assembles the members of the group, then a For Each loop takes each user in turn, adds the domain name to the user ID and then write to the group which has been created.

The workflow only needs to be run once to create each group. However, it is ultimately dependent on the consistency of information held in Active Directory.

Nintex offers the possibility of doing an LDAP query of directories such as Active Directory:

Any attributes (in the case of Nintex, termed “Property to retrieve”) which are present in Active Directory can be looked up and used within a workflow. Below is a table outlining common attributes.

Attribute

Result

givenName

First name

displayName

Last name, First name

manager

 

company

AnyCorp SA

streetAddress

1, Rue De La Grenouille

st

Geneva

co

Switzerland

c

CH

mail

firstname.lastname@anycorp.com

title

COLLABORATION & DOC MGMT WORKFLOW MGR

sAMAccountName

USERID

The possibility to set a multiple-line text column in a SharePoint List to Append-Only is a very useful functionality to have, but as is often the case with SharePoint 2007, it cannot quite be used to its full extent.

In a List View, an Append-Only text column displays as a link to open the Form, which can then display all the entries.

Many times, however, it would be useful to see in a view, just the last entry in an Append-Only column. How can this be achieved?

One way is to write a small workflow, using a tool such as Nintex, to copy the latest entry in an Append-Only text column, to another Single Line of Text column, which can then be hidden and prevented from appearing in the form, through the use of a content type.

The text in the Single Line of Text column will need cleaning up, to remove any fragments of HTML markup which are carried over.

In Nintex, this can be done using Regular Expressions that find and replace, for example, &nbsp; or <div> tags.

The result is a clean, single line of text column which display only the latest addition to an Append-Only multiple lines of text column.

The full history can be seen once the Form is opened.