Table of contents
- Context placeholders in expression builder
- Form placeholders
- Functions
- Item placeholders
- List placeholders
- Solution placeholders
- Page placeholders/functions
- User placeholders
- Web/Site functions/placeholders
Context placeholders in expression builder
The skybow Expression Builder helps users to easily write and verify expressions, set values and parameters, set dynamic conditions/validation rules in different places in Modern Forms, List Actions, Background calculated expressions, Scheduled and Triggered actions, etc.
Expression builder has a wide variety of context placeholders and functions that allow users to get properties from the context of the list, forms, site, user profile, etc., set dynamic conditions and validation to use them to write complex, powerful expressions in your solution.
Availability
Modern Forms | List Actions | Automation Actions |
Scheduled/Triggered Actions |
Background Calculated Expressions | |
Form placeholders | ✓ | - | - | - | - |
Functions | ✓ | ✓ | ✓ | ✓ | ✓ |
List placeholders | - | ✓ | - | ✓ | ✓ |
Page placeholders | ✓ | ✓ | ✓ | - | - |
User placeholders | ✓ | ✓ | ✓ | - | - |
Web/Site placeholders/functions | ✓ | ✓ | ✓ | ✓ | ✓ |
Below we will consider more about the functions available and how to use them.
Form Placeholders
Form placeholders get the properties of the form you are on. Form placeholders can used to set values in the expressions/actions (ItemID and ListID), and also evaluate some conditions, apply validation, etc. ( IsDisplayForm, IsEditForm, IsNewForm, and IsSubListForm). Form placeholders are available in the Modern Forms.
Form Placeholders | Purpose |
[[@Form.IsDisplayForm]] | Checks whether the form you are on is a Display Form. Return true or false |
[[@Form.IsEditForm]] | Checks whether the form you are on is a Edit Form. Return true or false |
[[@Form.IsNewForm]] | Checks whether the form you are on is a New Form. Return true or false |
[[@Form.IsSubListForm]] | Checks whether the form you are on is a Sublist Form. Return true or false |
[[@Form.ItemId]] | Returns the Id of the current item |
[[@Form.ListId]] | Returns the Id (GUID) of the current list |
Functions
Functions allow evaluate custom expressions inside the placeholders or inside a file. Functions also allow to extract (values) data from the list/library of the current site and also from the list/library of the other site collection. Backgrounds features like Scheduled/Triggered actions have also specific placeholders that could be used in the expressions.
Function | Purpose |
[[@Functions.EvaluateExpression('expression code')]] | This function evaluate expression inside the placeholder |
[[@Functions.GetFileContent('file path', false)]] | This function reads the file's content and returns its content optionally with evaluated expression - but the file is not changed. Parameter 'shouldEvaluate' (true/false) allows you to evaluate placeholders inside the file. Supported text files (e.g. txt, js, xml, html) |
[[@Functions.GetFirstValueForQuery('List server-relative or full Url', 'Caml query', 'FieldName')]] | Returns the first value of the specified field in the specified list based on the CAML query. |
[[@Functions.GetValuesForQuery('List server-relative or full Url', 'Caml query', 'FieldName')]] |
Returns the values of the specified field in the specified list based on the CAML query. |
[[@Functions.QueryList('List server-relative or full Url', 'Caml query')]] |
Return list items with specified query parameters |
[[@Functions.UTCToLocalTime('DateTime object or string')]]* | Converts date from UTC to Local time |
[[@Functions.LocalTimeToUTC('DateTime object or string')]]* | Converts date from Local time to UTC |
* These functions are available only for Scheduled and Triggered Actions
- [[@Functions.EvaluateExpression('expression code')]]:
[[@Functions.EvaluateExpression([[@Web.GetFirstValueForQuery('Settings',
'<View><Query><Where><Eq><FieldRef Name="Title"/><Value Type="Text">ApproveTaskEmailBodyTemplate</Value></Eq></Where></Query></View>',
'ExpressionCode')]])]]
- [[@Functions.GetFileContent('file path', false)]]:
[[@Functions.GetFileContent('[[@Web.Url]]/Shared%20Documents/emailTemplate.txt', true)]]
emailTemplate.txt:
Hi [[Assignedto]],
A new task was assigned to you:
Task: [[ID]]-[[Title]],
Due date: [[Duedate]],
Requested by: [[Author]],
Best Regards [[Created]].
Outputs:
- [[@Functions.GetFirstValueForQuery('List server-relative or full Url', 'Caml query', 'FieldName')]]:
var ID = [[@Functions.GetFirstValueForQuery('/sites/dev_sc/testingsolution/Lists/Tasks', '<View Scope="Recursive"><Query><Where><Eq><FieldRef Name="Status" /><Value Type="Text" ProviderType="Value">In Progress</Value></Eq></Where></Query></View>', 'ID')]]
alert(ID);
- [[@Functions.GetValuesForQuery('List server-relative or full Url', 'Caml query', 'FieldName')]]
[[@Functions.GetValuesForQuery('Lists/Invoice', '<View Scope="Recursive"><Query><Where><Eq><FieldRef Name="Status" /><Value Type="Text" ProviderType="Value">Done</Value></Eq></Where></Query></View>', 'Title')]]
- [[@Functions.QueryList('List server-relative or full Url', 'Caml query')]]
var items = [[@Functions.QueryList('Lists/Invoice', '<View Scope="Recursive"><Query><Where><Geq><FieldRef Name="InvoceDate" /><Value IncludeTimeValue="FALSE" ProviderType="DateTimeToday"><Today OffsetDays="0" /></Value></Geq></Where></Query><ViewFields><FieldRef Name="Title" /></ViewFields></View>')]]
var str = items.map((item) => { return item["Title"] + " created by " + item["Author"].get_email(); }).join(", ")
return str;
Item Placeholders
Item context placeholders allows to get properties from the item you are working on, such as Display form URL, Edit form URL, ID and can be used in your expressions. Item placeholders are available in the Modern Forms, List Actions, Scheduled and Triggered Actions and Background Calculated Expressions.
Item Placeholders | Purpose |
[[@Item.DisplayFormUrl]] | Returns the full URL to the display form of the current item |
[[@Item.EditFormUrl]] | Returns the full URL to the edit form of the current item |
[[@Item.Id]] | Returns the ID of the item |
List Placeholders
List context placeholders allows to get properties from the list you are working on, such as ID, Title, Internal name, URL, etc. and can be used in your expressions. List placeholders are available in the Modern Forms, List Actions, Scheduled and Triggered Actions and Background Calculated Expressions.
List Placeholders | Purpose |
[[@List.Id]] | Returns the Id (Guid) of the list |
[[@List.InternalName]] | Returns the internal name of the list |
[[@List.ServerRelativeUrl]] | Returns the server relative URL to the list |
[[@List.Title]] | Returns the title of the list |
[[@List.Url]] | Returns the full URL to the list |
Solution Placeholders
Solution context placeholders allows to get properties from the solution you are working on, such as solition ID and an email of the solution's owner. Solution placeholders are available only in Scheduled and Triggered Actions and Background Calculated Expressions.
List Placeholders | Purpose |
[[@Solution.OwnerEmail]] | Returns the Id (Guid) of the solution |
[[@Solution.Id]] | Returns the email of the solution's owner |
Page placeholders/functions
Placeholders retrieve the data in the context of the current page.
Page placeholders/functions | Purpose |
[[@Page.CultureName]] | Returns the culture name of the current site in context of the page |
[[@Page.GetQueryString('Type query string parameter name')]] | Returns the query string parameter for current window URL |
[[@Page.Language]] | Returns the default language of the current site in context of the page. |
[[@Page.UICultureName]] | Returns the UI culture name of the current site in context of the page. |
[[@Page.Url]] | Returns the URL for the page the user is in |
User placeholders
User placeholders return information about the current user such as email, ID, location, the info from the SharePoint user profile, etc. Also, user functions let to check the group membership (SharePoint group or Azure Active Directory Group) and the permission for the current user on the specific item, or on the list.
User Placeholders | Purpose |
[[@User.Email]] | Returns the email of the current user |
[[@User.Id]] | Returns the Id of the current user |
[[@User.IsMemberOfAADGroup('Type existing Azure AD group name')]] | Checks whether current user is member of AAD group |
[[@User.IsMemberOfGroup('Type existing SharePoint group name', checkNestedAzureADGroups)]] | Checks whether the current user belongs to the SharePoint group or belongs to SharePoint group as a member of the nested security AD group. Parameter 'checkNestedAzureADGroups' should be true/false. Note: If the 'checkNestedAzureADGroups' parameter is set to 'true', please ensure that API access request with 'Directory.Read.All' permissions is approved in the SharePoint admin center |
[[@User.LoginName]] | Returns the login name of the current user |
[[@User.Title]] | Returns the title of the current user |
User.HasPermission:
|
Checks whether the current user has appropriate permissions on the current list or on the current item |
User.Profile:
|
Gets the info from the SharePoint user profile |
Web/Site placeholders/functions
Web/Site placeholders will return the information about the current site collections or the current web. e.g. Title, URL, Language. ServerRelativeURL and URL can bring back the server relative and the full URL of the current site collection/web.
Also, context placeholder functions, like GetFirstValueForQuery and GetValuesForQuery, allow to retrieve values of the fields from the specified list using CAML Queries. Read more about the query functions here.
Site placeholders/functions | Purpose |
[[@Site.GetFirstValueForQuery('ListName or relative Url', 'Caml query', 'FieldName')]] | Returns the first value of the specified field in the specified list based on the CAML query. |
[[@Site.GetValuesForQuery('ListName or relative Url', 'Caml query', 'FieldName')]] | Returns the values of the specified field in the specified list based on the CAML query. |
[[@Site.QueryList('ListName or relative Url', 'Caml query', MaxRowNumber, 'View Fields', 'Viewattributes')]] | Return list items with specified query parameters |
[[@Site.ServerRelativeUrl]] | Returns the server relative URL for the site |
[[@Site.Url]] | Returns the full URL for the site |
Web placeholders/functions | Purpose |
[[@Web.CultureName]] | Returns the culture name of the current web |
[[@Web.GetFirstValueForQuery('ListName or relative Url', 'Caml query', 'FieldName')]] | Return the first value of the specified field in the specified list based on the CAML query. |
[[@Web.GetValuesForQuery('ListName or relative Url', 'Caml query', 'FieldName')]] | Returns the values of the specified field in the specified list based on the CAML query. |
[[@Web.Language]] | Returns the default language for the site |
[[@Web.QueryList('ListName or relative Url', 'Caml query', MaxRowNumber, 'View Fields', 'Viewattributes')]] | Return list items with specified query parameters |
[[@Web.ServerRelativeUrl]] | Returns the server relative URL for the current web |
[[@Web.Title]] | Returns the title for the current web |
[[@Web.Url]] | Returns the full URL for the current web |
- [[@Web.GetFirstValueForQuery('ListName or relative Url', 'Caml query', 'FieldName')]]:
var taskName = [[@Web.GetFirstValueForQuery('Task list', '<Where><Eq><FieldRef Name="Status" /><Value Type="Text" ProviderType="Value">Done</Value></Eq></Where>', 'Title')]];
alert(taskName);
- [[@Web.GetValuesForQuery('ListName or relative Url', 'Caml query', 'FieldName')]]:
[[@Web.GetFirstValueForQuery('Task list', '<Qwery><Where><Eq><FieldRef Name="Status" /><Value Type="Text" ProviderType="Value">Done</Value></Eq></Where></Query>', 'Title')]];
- [[@Web.QueryList('ListName or relative Url', 'Caml query', MaxRowNumber, 'View Fields', 'Viewattributes')]]:
var items = [[@Web.QueryList('Contacts', '<View Scope="Recursive"><Query><Where><Eq><FieldRef Name="Status" /><Value Type="Text" ProviderType="Value">Approved</Value></Eq></Where></Query><ViewFields><FieldRef Name="ID" /><FieldRef Name="Title" /><FieldRef Name="Author" /></ViewFields></View>', 10, 'ID, Title, Author', '')]];
var str = items.map((item) => { return item["Title"] + " created by " + item["Author"].get_email(); }).join(", ")
return str;