skybow Action Links User Guide

Document created by RosarioM on Aug 2, 2016Last modified by RosarioM on Oct 6, 2016
Version 12Show Document
  • View in full screen mode

 

Getting Started

Overview

 

The skybow Action Links App part allows extending SharePoint views, forms and pages in SharePoint Online (Office 365) or on-premise environment for users to execute actions by clicking on well-formed links in an app part.

Action Links are a way of providing easy work with list items, navigation between different site content and other additional functionality. They very much work in the same way as hyperlinks do and can significantly reduce the time that the user spends navigating through content.

 

KEY FEATURES:

  • Add Action Links on the forms, view of your SharePoint lists and site pages
  • Reorder and group the links easily using drag & drop functionality
  • Configure actions on links to add/update/delete list items, send mails, start workflows, show messages, open web pages and list forms, and others
  • Define conditions for executing each link
  • Use powerful expression-based calculations to set initial field values
  • Dynamically hide or disable links depending on complex conditions
  • Add/Delete/Rename links
  • Add an icon to a link
  • Multiple level links supported (up to 4 levels)

 

NOTES ON LICENSING:

  • All features are fully available during the trial.
  • After the trial only the users who want to customize pages using features not marked as free need a paid license.
  • Users who only need to use the customized pages will never need a license.

 

Support

For any questions or technical issues, you can contact us. Here are our contact details.

Support skybow

Action Links documentation

 

 

skybow Foundation

The functionalities of Add-Ins require a higher level of privileges on Office 365 since the Add-Ins that are offered in Microsoft store have some restrictions placed upon them. Therefore, the manually installed Add-Ins are permitted to execute the advanced actions.

The skybow Foundation Add-In is one such manually installed Add-In with some functional capabilities that are otherwise not allowed to be executed by us in MS store. This Add-In provides services for all the skybow Add-Ins to work efficiently as well as enhance their feature set. Essentially, instead of implementing the same set of capabilities in each of our Add-Ins, this utility is loaded with shared functionalities that can hence serve all our skybow Add-Ins.

 

 

Pre-requisites:

To be able to add this Add-In, you need to have site collection administrator privileges. Also, the scripting capabilities should be turned on in tenant-wide settings. The App Catalog must be modified accordingly to accommodate skybow Action Links app which works on-premises with SharePoint 2013 or higher.

 

  1. From your SharePoint environment go to Setting, Site Contents and then Add an App

 

SiteContents.PNG

 

2. Then on your left site click on SharePoint Store

 

arrow.png

 

3. And search for "skybow" products

 

 

 

4.  Select skybow Action Links Add-In from the list.

    The Office Store for skybow Action Links will be displayed.

    Click on Add It

 

 

 

5. In skybow Action Links App click on Request License.

    You will receive the License per e-mail.

 

 

6. After receive the License per e-mail, make the Upload.

 

 

 

7. The skybow Action Links app will appear on Lists, Libraries, and other Apps - Site Contents page.

    Click on skybow Action Links app.

 

8. The skybow Action Links App Homepage is shown

 

 

 

 

 

1. From any page where you are, go to Settings, Add an app. Will be displayed the Apps that you can add.

 

 

 

or

 

1. you can searching through the Filter.

 

 

2. And make Trust it

 

 

Request License

 

1. On Site Contents - Lists, Libraries, and other Apps click on skybow Rich Forms app.

    The skybow Action Links Forms App will be displayed

 

2. Select Request License

 

 

 

3. Fulfill the skybow License Request

4. And you will see the below message

5. You will receive your License per E-mail

 

Upload license

1. Go to skybow Action Links.

    One way it's, through the Site Contents - Lists, Libraries, and other click on skybow Action Links app.

 

2. On skybow Action Links page click on Upload License

 

 

3. Choose the License File to upload

 

4. The Action Links app will be displayed

 

 

Configuring skybow Action Links

 

 

After adding skybow Action Links,  it is listed under the Site Contents page.

Click on skybow Action Links to start the configuration.

 

The skybow Action Links App homepage is enabling you to configure the action links for Forms, Views or Pages.

 

The App page has the following sections:

  1. Instructions & Support - In this section, you can view introduction video, check out documentation or contact support if you cannot find a solution in the documentation.

  2. Configure Action Links – In this section, you can configure skybow Action Links to add it to Forms, Views or Pages.

  3. About This App – In this section, you can view version details and rate this Add-In.

  4. Other Accelerators from skybow – In this section, you can access to other skybow accelerators for SharePoint, such as skybow Rich Forms, skybow Tabbed Pages, skybow List View Search and skybow Theme Designer.

 

 

 

There are 2 ways in which you can add the skybow Action Links to either Forms or Views.

 

1. From the skybow Action Links App homepage

Specify where to add skybow Action Links and select the further options depending on it.

For more information, refer to the following sections:

  • Adding to Forms
  • Adding to Views
  • Adding to Pages

 

 

 

2. Out of the box app part inserting

The App Part can be placed on every possible List View, as well as on any Pages or List Forms:

  • Display Form
  • Edit Form
  • New Form

This is done by using the SharePoint functionality for adding an app part.

From page, go to Settings then Edit Page.

 

edit page.PNG

 

On the top of the header page click on App Part select the skybow Action Links and Add

 

 

Adding to Forms from Add-In App Homepage

On the Action Links app homepage, specify where to add Action Links and select further options depending on the form you select.

  • Select the required lists and libraries option where you want to insert the app part from the Lists and Libraries.
  • Select the required form from the Forms.
  • Click Insert Action Links

ConfiguringActionLinks.PNG

The new Action Links will be displayed on the selected form.

 

Adding to Views from Add-In App Homepage

On the Action Links app homepage, specify where to add skybow Action Links and select further options depending on the view you select.

  • Select the list you want to place the skybow Action Links.
  • Select the required form Views
  • Click Insert Action Links

 

ConfiguringActionLinksViews.PNG

 

Adding to Page from Web Parts Collection

The App Part can be placed on every possible List View, as well as on any Page, List or View with a List View web part on it.

  • Navigate to the page you want to add the skybow Action Links
  • Click Settings button and select Edit Page
  • On the page, you click Add a Web Part link

 

 

 

Or

 

  •    Click Settings button and select Edit Page.
  •    Select Insert > Web Part.

 

 

  • Select the skybow Action Links Web Part.
  • Click Add.

The web part will be added.

 

 

Configuring in Design Mode

 

Design Mode Configuration Overview

An administrator of a SharePoint environment can configure the Action Links app part.

This happens directly on the Page where the Action Links app part is placed in Edit mode of the page.

 

Note: You cannot edit the app part in View mode.

To get into design mode, navigate to Settings > Edit Page.

 

The web part is in Edit mode now.

 

ActionLinksEditmode.PNG

 

General Settings

The gear symbol available beside the 'Add action link' button ('+') at the bottom of the app part opens the General Settings dialog.

In this dialog the user can select the context where configuration will be saved. This allows to save the configuration of action links so it can be reused on multiple pages:

 

ActionLinksConfigure.PNG

 

List: the same configuration is reused on multiple Action Links app parts referencing this list.

Form: the same configuration is reused on multiple Action Links app parts on forms of the same list.

Page: the configuration is exclusively used on this app part on this page.

The context set by default when creating the app part depends on where the app part has been added: on list forms the "Form" context is pre-selected, on list views the "List" context is pre-selected and on any other pages the "Page" context is pre-selected.

 

1. List Context

 

ListContext.PNG

List context is always enabled. It is selected by default if the Action Links app part is added to a list view.

Selecting List context means that if the Action Links app part is placed somewhere where a list already exists, these action links are already presented in the app part.

The 'Save' button is disabled if the user has not specified a list or library. The user can define a list or library by clicking on 'Select List' button ('...') and then selecting it in the shown dialog.

 

2. Form Context

 

FormContext.PNG

 

 

'Form' context is enabled only on a form page. The user is not able to select this context on list views or site pages.

When the user selects 'Form' context on a form, a drop-down appears to select 'New', 'Display' or 'Edit'. This drop down is set automatically by default depending on the type of form the app part is on. The configured action links are stored separately for New, Display, and Edit forms. But it is possible to change the used configuration to another form type. For example changing the form type to 'Display' on an Edit form will show the action links configured for Display forms on this Edit form.

 

In 'Expression Builder' dialog the user is able to add placeholders for fields only if 'Form' context is selected in the General Settings dialog, or if the web part is added on a form with 'Page' context.

 

3. Page Context

 

Page context is always enabled. It is selected by default if the Action Links app part is added to site pages.

Selecting this context means that all configurations and Action links are saved individually for this Action Links app part.

 

When creating a form using SharePoint Designer the form contains a Data Form Web Part instead of a List Form Web Part. In these cases the 'Form' context is disabled and the default context is set to 'Page'.

When the user opens the General Settings dialog, a message notifies him that a form context can only be used if DataFormWebPart is converted to List FormWebpart:

 

generalsettingdialog.PNG

 

The provided 'Update Form' button enables converting to a List Form Web Part, so that the 'Form' context can be used.

 

 

A new link can be added by clicking on the Add button ('+') which appends a new link and places the cursor automatically for editing the title of the link:

 

addinglinks.PNG

 

The new link with the edited title are automatically saved after pressing Enter button or clicking anywhere outside the title.

 

The look of the links can be significantly improved by adding icons.

This can be done by clicking on the image rectangle left to the link's title. It also brings up a context menu for selecting images.

 

 

actionlinks5.PNG

 

There are three options to select a picture available:

  • From Computer

uploadimageActionLinks.PNG

 

 

  • From Address

fromaddress.PNG

 

  • From Sharepoint

fromsharepoint.PNG

 

To remove the icon, select the corresponding option in the context menu (this option is disabled if an icon has not yet been selected).

 

To delete a link, click on the Delete button ('x') right of the link's title

deletinglinks.PNG

and if shown confirm your intention by clicking 'Yes' in the dialog appearing:

deletelinks.PNG

The Confirmation dialog appears only if at least one action is added to the link or it's the parent link to links with actions, otherwise the link is removed immediately after pressing the Delete button.

 

Grouping and Ordering

Grouping and ordering of the links can be done in design mode using drag-and-drop functionality. Links can be dragged and dropped to reposition them.

The following are possible:

  • Moving a link inside a certain level.
  • Moving links from one level to another level to create hierarchically ordered links.
  • Moving a link or group containing multiple links.

A maximum of four levels is supported.

 

grouping.PNG

 

Action Link Status dialog provides an easy way to make a link dynamically show or hide or become enabled or disabled depending on complex conditions.

To configure conditions, click the gear symbol beside 'Delete' button ('x'):

 

ActionLinksaddcontact.PNG

 

It opens the Action Link Status dialog:

 

Enabled expression allows to enable or disable a link at run-time based on some condition.

For example, you can disable a link that is not allowed to be executed depending on field values or to prevent the user from clicking it depending on their group memberships.

 

Visible expression allows to change the visibility of a link at run-time based on some condition.

For example, you can hide or show a link based on the user permissions or on a form type: =[[@Form.IsNewForm]].

 

Expression-based values for these fields can be easily set using the placeholders available in Expression Builder.

 

Actions Builder

Actions Builder is a tool that allows to specify the actions for the configured links.

To open the Actions Builder dialog, the user can click on the lightning icon beside a link title:

 

ActionBilder.PNG

The Actions Builder dialog consists of two parts: the list of actions and the list of properties according to the selected action.

 

actionbuilder1.PNG

 

To add an action, click the 'Add Action' button.

All actions have the following general properties:

  • Title: Title to be displayed for the action in the list of actions. This is only to easily identify the actions in the list.
  • Condition: Define a case when the action should be executed.

       Expression-based values for the Condition field can be easily set using the placeholders available in Expression Builder.

  • Type: Defines the type of action to execute.

       Depending on the selected type, each action link has additional properties.

 

Actions are executed one by one in the order they are shown in the left hand list. To change the order of the actions, use the appropriate Up and Down arrow buttons.

 

Action Types

Action Links web part allows to display links that can trigger different actions.

The following action types are available:

  • Action Types
  • Add List Item
  • Delete List Item
  • Execute Script
  • HTTP Request
  • Open List Form
  • Open Web Page
  • Redirect to URL
  • Reload Page
  • Send Mail
  • Show Message
  • Start Workflow
  • Update List Item
  • Upload Document

 

Add List Item

Add List Item action allows adding a new list item dynamically to a specified list.

 

When action link type "Add List Item" is selected, the following additional properties can be specified:

  • List: a list where the new item should be added. It is possible to select the list:
    • From the current site, by selecting 'On current site' option and specifying an available list on the site.
    • From any site, by selecting 'On any site' option and specifying the list in 'Select List or Library' dialog or typing a server relative URL to a list.

               You cannot add an item to a library.

  • Content Type: Allows choosing the content type of the item to be added.
  • Fields specific for Content Type: Depending on the content type, all relevant fields are displayed at the bottom, so that for every field the value to be set can be configured.

 

When the Add List Item action is executed, the new item is added immediately setting the configured field values.

Expression-based values for these fields can be easily set using the placeholders available in Expression Builder.

Only specified fields will be updated. If you leave the field blank, it will not be changed.

 

 

   Example of Add List Item action configuration on the current site

 

actionbuilderonclick.PNG

 

 

Delete List Item

Delete List Item action allows deleting a list item dynamically.

 

When action type "Delete List Item" is selected, the following additional properties can be specified:

  • List: the list where an item should be deleted. It is possible to select the list:
    • From the current site, by selecting 'On current site' option and specifying an available list on the site.
    • From any site, by selecting 'On any site' option and specifying the list in 'Select List or Library' dialog or typing server relative URL to a list.
  • List Item Id: ID or expression to be evaluated as the ID of an item.

 

When the Delete List Item action is executed, the list item with the specified ID is deleted immediately.

Expression-based values for these fields can be easily set using the placeholders available in Expression Builder.

 

 

Example of Delete List Item action configuration

 

actionlinksonclick1.PNG

 

 

Execute Script

Execute Script action allows you dynamically run JavaScript scripts.

 

When action type "Execute Script" is selected, the Script body property should be specified.

Expressions are supported, thus making it possible e.g. to pass the current item ID to the script with [[ID]] inside. You can use Expression Builder for this.

 

 

Example of Execute Script action configuration

 

actionbuilderonclick2.PNG

 

 

HTTP Request

HTTP Request action allows sending different types of requests.

 

 

When action type "Execute Script" is selected, the following additional properties should be specified:

  • Url: URL or expression to be evaluated as URL.
  • Request Type: Provides options for choosing one of the following types:
    • GET
    • POST
    • PUT
    • DELETE
    • JSONP
  • Data: Data to be sent to the server. It is appended to the url for requests. Object must be Key/Value pairs ({ name: "John", location: "Boston" }) or XmlDocument.

 

  Expressions are supported, thus making it possible e.g. to pass the current item ID to the script with [[ID]] inside. You can use Expression Builder for this.

 

 

Example of HTTP Request action configuration

 

actionsbuildeonclick4.PNG

 

Open List Form

Open List Form action allows opening the New, Edit or Display form dynamically in a popup, dialog, the same or a new window.

 

When action type "Open List Form" is selected, the following additional properties can be specified:

  • List: The list where the form is located. It is possible to select the list:
    • From the current site, by selecting 'On current site' option and specifying an available list on the site.
    • From any site, by selecting 'On any site' option and specifying a list in 'Select List or Library' dialog or typing server relative URL to the list.
  • Form: Drop-down list with form types: New, Edit or Display (if Library is selected in the List field, only the Edit and Display options are available).

 

     According to selected form type, the following fields appears:

  • List Item Id: ID or expression to be evaluated as ID of an item if a Display or Edit form is selected.
  • Content Type: Provides option for choosing content type to be added if a New form is selected.
  • Additional Query String: Allows adding further text to query string (the question mark "?" or ampersand "&" does not need to be typed at the beginning).
  • Open in: Provides options for choosing how a form should be opened. There are four options available:
    • Modal dialog: the user is able to specify Title and dialog size: Auto size (selected by default) or custom Width and Height.
    • Parent frame
    • New window
    • Popup browser window: the user is able to specify Width (600 pixels by default) and Height (800 pixels by default).

 

Expressions are supported, thus making it possible e.g. to pass the current item ID using the  [[ID]] placeholder. You can use Expression Builder to easily assemble your expression.

 

Example of Open List Form action configuration

 

actionsbuilder0.PNG

 

 

Example of Open List Form action in modal dialog

 

Editcontact.PNG

 

 

 

Open Web Page

Open Web Page action allows executing URL or expressions to be evaluated as URL for the link.

 

When action type "Open Web Page" is selected, the following additional properties should be specified:

  • Url: URL or expression to be evaluated as URL.
  • Additional Query String: Allows adding further text to query string (the question mark "?" or ampersand "&" does not need to be typed at the beginning).
  • Open in: Provides options for choosing how a page should be opened. There are four options available:
    • Modal dialog: the user is able to specify Title, Width (600 pixels by default) and Height (800 pixels by default) as well.
    • Parent frame
    • New window
    • Popup browser window: the user is able to specify Width (600 pixels by default) and Height (800 pixels by default) as well.

 

Expression-based values for these fields can be easily set using the placeholders available in Expression Builder.

 

 

Example of Open Web Page action configuration

 

actionsbuilder6.PNG

 

 

Redirect to URL

Redirect to Url action allows navigating to a specified URL. The URL can be specified to be dynamically calculated using an expression.

When action type "Redirect to Url" is selected, the following additional properties can be specified:

  • Url: URL or expression to be evaluated as URL.
  • Use default source: if this option is checked, it redirects to the "Source" query string parameter of the current page or if this is not available to the default list view. When this is set the value entered in the URL field is ignored.

Expression-based values for the URL can be easily set using the placeholders available in Expression Builder.

"Redirect to Url' action should be the last in the actions list. All following actions will be ignored as it redirects to another page.

 

 

Example of Redirect to Url action configuration

 

actionsbuilder7.PNG

 

 

Reload Page

In some scenarios after some actions (i.e. updating or adding list item) it is necessary to reload the page. This can be done with the Reload Page action.

It does not require any additional properties.

 

"Reload Page" action should be the last in the actions list. All following actions will be ignored as it reloads the page.

 

 

Example of Reload Page action configuration

 

actionsbuilder8.PNG

 

 

Send Mail

Send Mail action that allows sending emails from your site that are generated dynamically.

 

When action type "Send Mail" is selected, the following additional properties should be specified:

  • From: Sender of the email: User or expression to be evaluated as a user.
  • To: Receiver(s) of the email: User or expression to be evaluated as a user.
  • CC: User or expression to be evaluated as a user that will receive a copy of the message.
  • BCC: User or expression to be evaluated as a user that will receive a copy of the message and are concealed from the other recipients.
  • Subject: Subject of the email to be sent.
  • Body: Message to be sent.
  • Send As Text: If enabled, email is sent in plain text otherwise it is sent as HTML mail.

 

Mails will be sent only from and to users in the current tenant.

 

Example of Send Mail action configuration

 

actionsbuilder9.PNG

 

 

Show Message

Show Message action allows showing messages dynamically as a dialog, status or notification.

 

When action type "Show Message" is selected, the following additional properties can be specified:

  • Text: Template expression defining the message to be displayed (HTML tags can be used as well).
  • Show as: Provides options for choosing how a message should be shown.  There are three options available:
  • Dialog: the user is able to specify Dialog Title, Width (400 pixels by default) and Height (150 pixels by default).
  • Status: the user is able to specify Status Title, Delay in seconds (if "0" is set, the message does not disappear unlit the page is refreshed), and Color (Information, Success, Warning, Error)
  • Notification: the user is able to specify Delay in seconds (if "0" is set, the message does not disappear unless the page is refreshed).

 

Expression-based values for these fields can be easily set using the placeholders available in Expression Builder.

 

 

Example of Show Message action configuration

 

actionsbuilder10.PNG

 

 

Start Workflow

Start Workflow action allows starting a SharePoint Workflow dynamically

 

When action type "Start Workflow" is chosen, the following additional properties should be specified:

  • Work Flow Name: The name of workflow for current list or content type.

        Only SharePoint 2013 workflows are supported.

  • List Item Id: Id or expression to be evaluated as Id of an item.

 

  Expression-based values for these fields can be easily set using the placeholders available in Expression Builder.

 

Example of Start Workflow action configuration

 

actionsbuilder13.PNG

 

 

Update List Item

Update List Item action allows updating a list item immediately with configurable values.

 

When action type "Update List Item" is selected, the following additional properties can be specified:

  • List: the list where the list item should be updated. It is possible to select the list:
    • From the current site, by selecting 'On current site' option and specifying an available list on the site.
    • From any site, by selecting 'On any site' option and specifying the list in 'Select List or Library' dialog or typing server relative URL to a list.
  • List Item ID: ID or expression to be evaluated as ID of the item.
  • Fields specific for current list: At the bottom of the configuration all fields of the selected list are shown, so that for every field the value to be set can be specified.

 

Expression-based values for these fields can be easily set using the placeholders available in Expression Builder.

It is possible to set null (as Assignment expression "=null") and " " (empty string) values.

Only specified fields will be updated. If you leave the field blank, it will not be changed.

 

 

Example of Update List Item action configuration

 

Builder.PNG

 

 

 

Upload Document

Upload Document action allows uploading files to a library dynamically in a popup, dialog, the same or a new window.

 

When action type "Upload Document" is selected, the following additional properties can be specified:

  • Document Library: The library that you want to upload a document to. It is possible to select the list:
    • From the current site, by selecting 'On current site' option and specifying an available library on the site.
    • From any site, by selecting 'On any site' option and specifying a library in 'Select List or Library' dialog or typing server relative URL to the llibrary.
  • Target Folder: Url or expression to be evaluated as URL to a folder in the document library where the document should be saved. You also can use 'Choose Folder' dialog.
  • Additional Query String: Allows adding further text to query string (the question mark "?" or ampersand "&" does not need to be typed at the beginning).
  • Open in: Provides options for choosing how a Upload Document form should be opened. There are four options available:
    • Modal dialog: the user is able to specify Title and dialog size: Auto size (selected by default) or custom Width (600 pixels by default) and Height (800 pixels by default).
    • Parent frame
    • New window
    • Popup browser window: the user is able to specify Width (600 pixels by default) and Height (800 pixels by default) as well.

 

  Expression-based values for these fields can be easily set using the placeholders available in Expression Builder.

 

 

Example of Upload Document action configuration

 

Builder1.PNG

 

 

Choose Folder dialog

 

builder3.PNG

 

 

 

Expression Builder

Use the Expression Builder to easily write and verify expressions. Expression-based calculations allow you to set paramaters dynamically for actions.

 

To open the Expression Builder dialog, click on the "fx" icon beside a text field on the Action Builder or the Action Link Status dialogs:

 

 

actionsbuildeonclick4.PNG

 

Use the dropdown to select between the different expression types.

 

 

expressionbuilder.PNG

 

Enter the expression in the text editing box.

To assist inserting placeholders all available fields and context object placeholders on the right hand panel are shown and can be added using the arrow button or by double clicking.

The entered expressions can be verified by clicking the 'Test' button.

 

 

Expressions

Throughout the Actions Builder expressions can be used to dynamically calculate properties for the actions configured.

 

 

Expression Types

To cater for different uses any expression can be defined in any of the following forms: Template Expressions, Assignment Expressions, Function Code Expressions.

 

 

  • Template Expressions

Text templates are a special form of expressions in which placeholders are replaced by string representation (always returns a string, placeholders are always converted to string before inserted). Placeholders can contain field paths (e.g. [[@User.Email]]) or expression placeholders [[=new Date()]] (begin with equals sign).

 

 

This form allows to define textual values in a simpler, more abreviated and suitable manner than the other forms. As an example, we can write '[[Firstname]]  [[Lastname]]' for a calculation of a text field value, instead of needing the more complex value expression ('=[[Firstname]] + " " + [[Lastname]]').

 

 

Syntax:  Use plain text containing placeholders to insert dynamically calculated text.

Example: Use the expression 'Welcome [[Firstname]] [[Lastname]]!' to calculate the text 'Welcome Mary Hunter!' when the values of field Firstname and LastName are 'Mary' and 'Hunter'

 

 

  • Assignment Expressions

With assignment expressions you can define texts and values to be calculated using JavaScript-based assignment terms.

 

 

Syntax: The "=" sign at the beginning of expressions signals that it is an assignment expression, otherwise it is evaluated as a template expression. When the assignment expression type has been selected in the expression builder the equals sign does not need to be typed though. Use placeholders in double square brackets to access a field value or context object that is dynamically evaluated.

Example: = [[MyTest]] + ' is calculated value'

 

 

  • Function Code Expressions

Using function expressions more complex calculations can be defined. The expression allows using the full scope of JavaScript code as in bodies of JavaScript functions. Values must be returned using 'return <value>;' statements.

 

Syntax: Starting with "{" signals that it is a function body expression. In the expression builder the curly brackets don't need to be typed though. Except for the use of placeholders in double square brackets to inject field values and context information the syntax is the same as used in JavaScript function bodies.

Example: { var myValue = [[Title]]; if (myValue.indexOf('Test') > -1) return "Is Test"; else return myValue; }

 

 

Expression Examples

 

Initially setting date time fields

 

= new Date()Set the current date time (can also be done just by using SharePoint default column value available in column's configuration)
= new Date(2014, 5, 3)Set the date to 3rd June 2014. Note: The month (2nd) parameter is 0-based, so January is 0 and December is 11.
= new Date().addDays(10)Set the date to current date (and time) plus 10 days. Use addDays(-n) to subtract n days.
= new Date().addHours(4)Set the date to 2 hours in future.
= new Date().addYears(-1)Set the date a year ago from today.

 

 

Calculating date time fields

 

=[[StartDate]]Get the date time field of another date time field. Note: Use Assignment expression when setting fields using calculated expressions.
=[[StartDate]].addDays(10)Get the date time field of the StartDate column plus 10 days.

{
if ([[ContractType]] == "Monthly")
  return [[StartDate]].addMonths(1);
else if ([[ContractType]] == "Quarterly")
  return [[StartDate]].addMonths(3);
else if ([[ContractType]] == "Semi-Annually")
  return [[StartDate]].addMonths(6);
else if ([[ContractType]] == "Annually")
  return [[StartDate]].addYears(1);
else return null;
}

Get a date depending on value of field ContractType and StartDate. When ContractType is "Monthly" the date is calculated as StartDate plus 1 month, when ContractType is "Quarterly" the date is calculated as StartDate plus 3 months, etc. If ContractType does not match any of the checked values no date is returned.

 

As an example this function expression could be used as a calculated expression to set the RenewalDate field of a contract item.

 

 

Using JavaScript to define list item which is selected on list view

 

{

var ctx = SP.ClientContext.get_current();
var items = SP.ListOperation.Selection.getSelectedItems(ctx);
return items.length == 1;

}

Check whether only one item is selected in the list (Can be used in Condition property.)

{

var ctx = SP.ClientContext.get_current();
var items = SP.ListOperation.Selection.getSelectedItems(ctx);
if (items.length == 1)

  { return items[0].id; }
return null;

}

Returns Id of List Item which is selected on a view.

 

 

Placeholders

 

Placeholders are defined using double square brackets: [[...]] . The placeholders may contain either a field value path, a context object, context function or an embedded expression:

 

Field Value Path

Using field value paths allows specifying which column value should be returned for the placeholder. The value can be retrieved for a field on the form or any field connected using lookup fields on the form. A value path consists of one or more elements seperated by a dot '.' (i.e. 'Projects.Customers.Title'). The first element always defines a field of the current item of the form. Depending on the field type further elements can follow:

  • Lookup: When "Key" or "Value" follows as element the ID or Value of the lookup are returned (i.e. [[MyLookup.Key]]). Alternatively elements can also follow defining a field in the target list of the lookup of which the value should be returned for (i.e. [[MyLookup.SomeField]]).
  • User: "Email", "Title", "LoginName" and "Id" can be used to retrieve specific information for the selected user(s).

 

 

Context Object Values & Functions

Values for contextual information can be defined in placeholders using the [[@...]] syntax. These can be used to retrieve values (i.e. [[@User.Profile.Department]]) or evaluate contextual functions (i.e. [[@User.IsMemberOfGroup('Portal Owners')]]).

 

 

Embedded Expressions

When the placeholders content begins with "=" or "{" the placeholder content is evaluated as an assignment or function body expression. This can be very helpful to embed calculations inside template expressions (i.e. "Contract [[=new Date()]").

 

Examples

 

[[Title]]Form Field - returns the form fields current value
[[MyLookup.Key]]Lookup ID - returns the ID of the item the lookup is referencing
[[MyLookup.Value]]Lookup Value - returns the value (text displayed) of the lookup for the item
[[MyLookup.SomeField]]Field Lookup - field value is retrieved from related list
[[SomeUserField.LoginName]]User Login - login name of the user referenced by the user field SomeUserField
[[SomeUserField.Email]]User Email - email of the user referenced by the user field SomeUserField
[[=new Date()]]Embedded Value Expression - Will be evaluated as a value expression (example: current date)

[[@User.Email]]
[[@User.Profile.Department]]
[[@User.IsMemberOfGroup('Portal Owners')]]

Current User Context Objects & Functions - Retrieves information for the current context
Current users email
Current users department retrieved from user profile information
Checks if current user is a member of the user group 'Portal Owners'

Attachments

    Outcomes