Function Builder


Dockit provides an ability to assign a calculated value for a SharePoint column based on user-defined functions. The custom function generates column values based on metadata file column, file properties or free text entered by the user. Dockit will prepare the metadata value based on the custom function and assign it to respective SharePoint column.

The metadata file column or file property (like Title.[metadatafile], Author.[fileproperty]) can be input as a parameter in a specific syntax. Note that the Function Builder tool recognizes the given parameter as metadata file column only if it ends with .[metadatafile] and similarly it recognizes the parameter as file property only if it ends with .[fileproperty].

To create a custom function and assign it to the SharePoint column, perform the following steps:

1.

Select <new function> under 'Function Builder' as Source from the list as shown below:

 

2.

The Function Builder Dialog will appear as shown below:

3.

Enter a character in a textbox. If a character or substring starts with the built-in function name, suggestion list will appear as shown below:

 

 

4.

Select a function name from the list and press Enter key or Double Click to add the selected function to the function builder. 

NOTE: You can also add the built-in function to the function builder by click 'Insert button' and select a function in the function list.

 

 

5.

To add a file property or column in the metadata file as a parameter to the function, Enter a double quotes followed by character or sub string of a property. If the character starts with file property name or metadata file column name,  then suggestion list will appear as shown below:

 

 

6.

Select a property name and press Enter key or Double Click to add as a parameter for the function.

 

 

7.

You can also provide a free text or integer as parameters for the function, if desired.

 

 

8.

You can also use nested functions too as shown below:

 

 

9.

Click the question mark image in the function builder to show the information about built-in function in Dockit.

 

 

10.

Select the option to show the information about the function in Dockit.

 

 

11.

Information about the function in Function Builder Help dialog as shown below:

 

 

12.

Click OK to insert the custom function in Function Builder dialog and proceed.

 

Dockit Built-in Functions

Concatenate

Joins several texts into one string.

Syntax

Concatenate(Value1, Value2, Value3,….)

where Value(x): File / Metadata property or enter free text in double quotes.

Right

Returns the string value from the end of the string up to the specified number of characters.

Syntax

Right(Property / Value, Count)

  • Property/Value: File / Metadata property or enter free text in double quotes.
  • Count: Number of characters.

Left

Returns the string value from the start of the string up to the specified number of characters.

Syntax

Left(Property / Value, Count)

  • Property/Value: File / Metadata property or enter free text in double quotes.
  • Count: Number of characters.

RTrim

Removes the specified number of characters from the end of the string.

Syntax

RTrim(Property / Value, Count)

  • Property/Value: File / Metadata property or enter free text in double quotes.
  • Count: Number of characters.

LTrim

Removes the specified number of characters from the start of the string.

Syntax

LTrim (Property / Value, Count)

  • Property/Value: File / Metadata property or enter free text in double quotes.
  • Count: Number of characters.

GetFolderName

Returns the folder name at a specified hierarchical level from the complete folder path.

Syntax

GetFolderName(Property / Value, Level)

  • Property/Value: File / Metadata property or enter free text in double quotes.
  • Level: Hierarchical level of the folder name to return.

GetDay

Returns the day value of the given date.

Syntax

GetDay(Date value)

  • Date Value: File / Metadata property or enter free text in double quotes.
    Note: "Now" free text is used to set a current date and time.

GetMonth

Returns the month value of the given date.

Syntax

GetMonth(Date value, Format)

  • Date Value: File / Metadata property or enter free text in double quotes.
    Note: "Now" free text is used to set a current date and time.

  • Format: Month format to extract.("MM","MMM","MMMM")

GetYear

Returns the year value of the given date.

Syntax

GetYear(Date value, Format)

  • Date Value: File / Metadata property or enter free text in double quotes.
    Note: "Now" free text is used to set a current date and time.

  • Format:  Year format to extract.("YY","YYYY")

GetTime

Returns the time value of the given date.

Syntax

GetTime(Date value)

  • Date Value: File / Metadata property or enter free text in double quotes.
    Note: "Now" free text is used to set a current date and time.

GetDateDiff

Returns the difference between two date values.

Syntax

GetDateDiff(Date value, Date value)

  • Date Value: File / Metadata property or enter free text in double quotes.
    Note: "Now" free text is used to set a current date and time.

If

Checks the condition, and returns one value if TRUE, and another value if FALSE.

Syntax

If(Property / Value, Condition, True part, False part)

  • Property/Value: File / Metadata property or enter free text in double quotes.
  • Condition: Specified formula condition.(StartsWith,EndsWith,EqualsTo)
  • True Part: Characters or String.
  • False Part: Characters or String.

GetString

Returns the string value that matches with the regular expression pattern.

Syntax

GetString(Property / Value, Pattern)

  • Property/Value: File / Metadata property or enter free text in double quotes.
  • Pattern: Any regular expression pattern to search.

Split

Split the given string with a specified character and returns the value from the specified occurrence.

Syntax

Split(Property / Value, Split Character, Occurrence)

  • Property/Value: File / Metadata property or enter free text in double quotes.
  • Split Character: Character separator to split the given string.
  • Occurrence: Integer value to return the string at specified occurrence.

 

 

Example of custom functions and their resultant values: 

Function

Sample Metadata file column Value

Sample File Property Value

Result

Remarks

Right("Title.[metadatafile]",5)

test value

value

Right function returns last two characters from the value in the metadata file column 'Title'

Left("Title.[fileproperty]",2)

test property value

te

Left function returns the first two characters from the value in the file property 'Title'

RTrim ("Sample Value",5)

Sample

Rtrim truncates Value from the given value Sample Value and returns Sample

LTrim ("Demo Version",5)

Version

LTrim function truncates Demo from the given value and returns Version

GetFolderName("path.[fileproperty]" ,2)

C:\Sample Folder\Test\Demo.txt

Sample Folder

Returns the name of the folder at level two in the full path

GetDay("Created Date.[fileproperty] ")

11/21/1986

21

Returns the date value 21 from the date.

GetMonth("Modified Date.[fileproperty]", "MMM")

11/21/1986

Nov

Returns the month value in MMM format from the date.

GetYear("Date Field.[metadatafile]", "YY")

09/21/1990

90

Returns the year value in YY format from the given date.

GetTime("Time field.[metadatafile]")

09/21/1990 15:05:05

15:05:05

Returns the time value from the given date.

GetDateDiff("Created Date.[fileproperty]","Date Field.[metadatafile]")

09/21/1990

09/ 21/1989

366

Returns the difference between two date values.

Concatenate("Title.[FileProperty]","-","Name.[MetadataFile]")

Content

Type

Type-Content

Joins several texts into one string.

If("Title.[fileproperty]","StartsWith[FileShare]","File","Folder")

FileShare Document

File

If the condition is TRUE, it returns the True part string value.

Split("Name.[fileproperty]","_",2)

Dockit_UserManual_2012

UserManual

Splits the given string based on the split character (_) and returns the value from the second part / occurrence.

GetString("Title.[metadatafile]","\w{4}")

test case

test

Returns the string value that matches with the regular expression pattern.