Apr16

New in Nintex Workflow 2007: Inline Functions

Tags: Nintex Workflow

With the latest build Nintex added again lots of new features. Besides the product now supports multilingual user interfaces, it also offers the possibility to use inline functions. These functions focus on manipulating and formatting string and date values and are mostly clones of existing functions known from the .net Framework. You can use the functions in any inputbox within the Nintex Workflow Designer, see the example below.

This is how it works:

"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."

The current build [10903] supports the following functions:

Function

Description

fn-FormatDate

Represents a date time value in text of a specific format.
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-Currency

Represents a numeric value as a currency formatted text.

fn-Substring

Extracts a portion of text from a string.

fn-Replace

Replaces a section of text in a larger string.

fn-ToTitleCase

Formats text in a string to title case.

fn-ToUpper

Formats text in a string to all upper case.

fn-ToLower

Formats text in a string to all lower case.

fn-Length

Returns the number of characters in a string.

fn-PadLeft

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

fn-PadRight

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

fn-Remove

Removes a section of text in a larger string.

fn-Insert

Adds text in to a larger string.

fn-Trim

Removes leading and trailing whitespace from a string

fn-Abs

Returns the absolute value of a number

fn-Max

Returns the greater of two numbers.

fn-Min

Returns the lesser of two numbers

fn-Round

Rounds a decimal value to the nearest integer.

fn-Power

Raises a number to the specified power.

fn-DateDiffDays

Determines the number of days between two dates

fn-DateDiffHours

Determines the number of hours between two dates

fn-DateDiffMinutes

Determines the number of minutes between two dates

fn-DateDiffSeconds

Determines the number of seconds between two dates.

fn-XmlEncode

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

fn-XmlDecode

Decodes a html safe string to regular text

fn-NewGuid

Generate a globally unique identifier.



That´s rich! J

Markus



 
Apr8

Set user permissions for a Website with Nintex

Tags: Nintex Workflow, PowerActivity, PowerShell, SharePoint

If you use the "Create a Site" activity with Nintex Workflow 2007, there is no way to assign detailed user permissions for the newly created site - you can only choose to either inherit the permissions from the parent site or you can manually set a single user as site owner.

But here is the solution: Use the Data One PowerActivity and a few straightforward lines of PowerShell code to manage the user permissions and roles in detail!

   

$webDestination = get-spweb "{WorkflowVariable:AbsolutURL}"

$webDestination.BreakRoleInheritance($true)

$roleAssignment = new-object Microsoft.SharePoint.SPRoleAssignment -argumentList "domain\user"

$roleDefinition = $webDestination.RoleDefinitions["Contribute"]

$roleAssignment.RoleDefinitionBindings.Add($roleDefinition)

$webDestination.RoleAssignments.Add($roleAssignment)

$webDestination.Dispose()

Insert the PowerActivity after the "Create a site" activity within the Nintex Workflow Designer canvas. Paste the PowerShell snippet into the PowerActivity. Use $webDestination to set the new site's URL, which you can easily obtain from the "Create a site" activity (configuration dialog > Store URL in). Set -argumentList and RoleDefinitions["Contribute"] according to your requirements. Run your workflow and see for yourself that all permissions have been created automatically.

Regards,

Andreas