Add the Custom Inline Function using PowerShell

You can add your inline function by registering your method name with Nintex Forms so that the method will be available in the list of functions in the Forms designer and will execute in the Forms filler at run time. To add the function, you must add your DLL to the GAC, and then use the SharePoint 2013 Management Shell and Nintex Forms PowerShell cmdlet Add-InlineFunction to register the assembly and function information.

Tot add your inline function:

Find the public key token for the assembly

To find the public key token for your strongly named assembly you can use the Developer Command Prompt for Visual Studio.

To find the public key token

  1. Open the Developer Command Prompt for Visual Studio.
  2. Type CD and navigate to the folder containing the DLL for your solution.
  3. Type sn –T <dllname>.dll
  4. Make note of the assembly name, and public key token. You will use this in registering the custom control with Nintex Forms.

Add the assembly for the control to the GAC

Manually add the custom control assembly to the Global Assembly Cache (GAC) on the server.

  1. Open the Developer Command Prompt for Visual Studio as an administrator.

  2. In Command Prompt, run the following command, replacing <assemblyPath> with the full path and file name of the assembly:

    gacutil /i <assemblyPath>

For more information about manually adding an assembly to the GAC, see Install the assemblies into the Global Assembly Cache.

Construct the Assembly Name String

Your assemble name will follow this pattern:

<dllname>, Version=<0>.<0>.<0>.<0>, Culture-neutral,PublicKeyToken=<dlltoken>

For example your assembly name may look like:

Custom.InlineFunctions.Custom, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1b923b394396c09b.

Create the attributes for the inline function description

With the assembly name string, you can create your inline function description. The following table contains the attributes.

Attribute Example Description
FunctionAlias fn-Piglatin You will use the function alias in adding the function to your forms. Nintex Forms alias follow the pattern, fn-methodname.
AssemblyName Custom.InlineFunctions.Custom, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1b923b394396c09b See Construct the Assembly Name String.
Namespace Custom.InlineFunctions.Custom The namespace that contains the function. Typically this is the same as your DLL.
TypeName Custom The name of the class that contains the your function.
MethodName Piglatin The name of the method (that is the function.)
Usage fn-Piglatin(input string) Specify how the function should be called. If it takes parameters specify the datatype.
Description Returns the string as Pig Latin. This is a text description of the function.
Lcid NA NA
Hidden False If set to true will conceal the function form the list of functions in Nintex Forms.

Add the Inline Function to Nintex Forms

You can use SharePoint 2013 Management Shell to add the Assembly Name, function, and associate with the function alias.

To add the custom inline function using SharePoint 2013 Management Shell

  1. On the SharePoint server, open the SharePoint 2013 Management Shell.
  2. Type:

    Add-InlineFunction -FunctionAlias fn-Piglatin -AssemblyName "Custom.InlineFunctions.Custom, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1b923b394396c09b" -Namespace Custom.InlineFunctions.Custom -TypeName Custom -MethodName Piglatin -Usage "fn-Piglatin(string to translate)" -Description "Returns the string as Pig Latin."

  3. Verify the function has been added to the list of Nintex Forms functions, and type:

    Show-InlineFunctions

Related information

Add a Custom Inline Function with SharePoint 2013 Management Shell

Add-InlineFunction

Show-InlineFunctions