Try it
  • Examples
  • Features
  • Testimonials
  • Partners
  • Pricing
  • Support
    • Sintel Apps Help
    • Sintel Apps Release History
    • Sintel BI Help
    • Sintel BI Release History
    • Webinars
    • How to video series
    • Ask the community
    • Submit a ticket
    • Request a demo
    • Compare us
  • Blog
  • Examples
  • Features
  • Testimonials
  • Partners
  • Pricing
  • Support
    • Sintel Apps Help
    • Sintel Apps Release History
    • Sintel BI Help
    • Sintel BI Release History
    • Webinars
    • How to video series
    • Ask the community
    • Submit a ticket
    • Request a demo
    • Compare us
    • For Schools
  • Blog
  • Get Started
How can we help?

Search for answers or browse articles about Sintel Forms

Filter by categories Clear Results
  • About Sintel Forms

    • SharePoint List types supported by Sintel Forms
    • What is Sintel Forms
    • Why we built it
    • Sintel Apps and the security of your data
  • Getting Started

    • How to Install Sintel Forms
    • Adding Sintel Forms to a SharePoint Site
    • Authorizing Sintel Forms
    • Install Sintel Forms for SharePoint On-Prem
    • Sintel Forms Best Practices
  • Product Updates

    • Release History
    • Updating Sintel Forms for SharePoint On-Prem
    • Differences between the Cloud and On-Prem Versions of Sintel Forms
  • Settings

    • External Access Settings

      • Understanding External Access Settings in Sintel Forms
      • External Submissions
      • External Collaboration
      • External Sharing
      • External Access Settings
    • After save script
    • Basic Features
    • Conversations
    • Form Viewer
    • Hide Sintel Branding
    • Payments
    • Theme & Styling 
    • Confirmation screens
    • Localisation
    • How to avoid SharePoints list view threshold
  • Layout

    • About Layout
    • Adding and Editing Linked List items using Inline, Dialog & Sintel Forms Embedded
    • Adding Fields
    • Creating Calculated Fields & Using Formulas
    • Default values & custom values
    • Field and Section Validation
    • Linked Libraries-Using a Document/Picture Library
    • Linked Lists-How to add attachments
    • Sections - Tab order
    • Setting field properties within a Linked List
    • Using a Linked List
    • Form Header and Footer
    • New "Cosy" Form Interface
  • Workflow

    • About Workflow
    • Workflow: Statuses
    • Workflow: Actions
    • Workflow: Email
    • Workflow: Payment Actions
    • Deprecation of the SintelFormsWorkflow list
  • Logic

    • About Logic
    • Logic: Steps
    • Logic: Conditions
    • Logic: Rules
  • Reminders

    • Reminders
  • Basic Customisation

    • Applying a theme and adding icons or graphics
    • Changing button colours or hiding them
    • Embedded Action Buttons (deprecated)
    • Customising Send-From Address for Sintel Apps Emails
  • Advanced Customisation

    • The JavaScript API

      • Articles coming soon
    • Accessing external APIs
    • Creating custom buttons using JavaScript
    • Custom form styling using CSS
    • Programmatically creating Sintel Forms
    • The JavaScript API
    • Using query string parameters for default/calculated values
    • Restrict access to users not found in a SharePoint group
    • Advanced Customisation and Code Samples
    • Advanced Customisations: Quick Navigation Guide
  • FAQs

    • FAQs
    • Activating Sintel Forms on newly created tenants
    • Lists and columns used by Sintel Forms
    • Support and Training
    • Track the usage of Sintel Forms
    • Differences between the Cloud and On-Prem Versions of Sintel Forms
    • Permissions used by Sintel Forms
    • Permissions required to use the Sintel Forms Designer
    • SharePoint Add-Ins are retiring what can you do
  • How To Guides

    • Automatically add linked items or files
    • Change the layout of Choice Fields
    • Configure a cascading drop-down
    • Configure Printing Options
    • Debugging your forms
    • Embedded Action Buttons (deprecated)
    • Export a form template
    • How to complete a form action with Power Automate
    • Import a form template
    • Lookup Columns: Control the sort order
    • Lookup Columns: Retrieve additional columns from Lookup List
    • Make Attachments Mandatory
    • Set & clear field values using rules
    • Share a Form
    • Track the usage of Sintel Forms
    • Transferring your license to another tenant
    • Use Sintel Embedded Mode on a linked list
    • Use a Rule to check if third party cookies are enabled
    • Customising Send-From Address for Sintel Apps Emails
    • Recommended Permissions For Forms and Apps
    • Disable Sintel Forms on a list
    • Show all articles ( 6 ) Collapse Articles
  • Widgets

    • Buttons
    • Workflow History
    • HTML Widget
  • Noteworthy Features

    • Attachments and Image Previews
    • Image Annotations
    • Ink Signatures
    • Sintel Forms Mobile App
    • Workflow History
  • Troubleshooting

    • The redirect URL specified in the request does not match
    • Everything is fine but we had a small problem getting your license
    • "401 Unauthorized" error during form data save
    • "500 internal server error" on form opening
    • Activating Sintel Forms on newly created tenants
    • Ad blockers and Privacy Extensions
    • Attachments option missing in Sintel Forms
    • Changing the Content Approval settings of a list can cause an issue with Sintel Forms
    • Enabling third-party cookies
    • Handling the list view threshold for the Workflow and Conversations features
    • No actions appearing in the actions menu
    • Sintel Forms doesn't appear to be applied to a list
    • Sintel Forms Designer not available in the list command bar
    • Sintel Forms Save Process
    • Site naming and Sintel Forms
    • The remote server returned an error: (401) Unauthorized when importing a form template
    • Workflow emails containing incorrect links to forms
    • Workflow emails not being received by distribution lists or mail-enabled security groups
    • Workflow emails not being received by SharePoint group members
    • Data load error: Connection to SharePoint has been lost. Please reload the page.
    • Data save error: Access denied. You do not have permission to perform this action or access this resource
    • Email address of a Shared Mailbox not recognised by Sintel Forms
    • Add an exception for Sintel Forms instead of enabling third-party cookies
    • Export to PDF not working on SharePoint Subscription Edition
    • "404 FILE NOT FOUND" when attempting to open a new form or existing form
    • Show all articles ( 10 ) Collapse Articles
  • Code Samples

    • Embedded Action Buttons (deprecated)
    • Set email address from person field
    • Validate email addresses
    • Advanced Customisation and Code Samples
    • Advanced Customisations: Quick Navigation Guide
  • Sintel General Info

    • What we do
    • Who we are

The JavaScript API

Posted4 August 2020
Updated29 October 2025
ByEoin McMahon
You are here:
  • Main
  • Advanced Customisation
  • The JavaScript API
0 out of 5 stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
< All Topics

Sintel Forms contains a rich JavaScript API that can be used to manipulate fields on forms.

In all cases, when manipulating fields, the fieldName parameter must match the internal name of the SharePoint field or column and not the Title nor the display name set within the layout in Sintel Forms.

You can use this API to quickly get and set various fields on a form using conditions and steps within rules in the logic screen of the Sintel Forms Designer.

Function

Description

getValue()

Returns the value of a field on the form

setValue()

Sets the value of a field on the form

getCurrentUser()

Returns the details of the currently logged in user

setCurrentUser()

Sets the details of the currently logged in user

setCurrentDate()

Sets the current date

setErrorMessage()

Display custom error

updateLookupValues()

Overrides the contents of dropdown (lookup fields)

replaceChoicesWithImages()

Replacing multi choice text options with images

getUserProperties() 

Get data from user information list

getFilteredFirstListItem()

(aka VLOOKUP) Get the first matching list item from another list using a filter

getFilteredListItems() 

(aka VLOOKUP) Get all list items from another list using a filter

cascadingDropdowns() 

Allows the set up of a cascading relationship between dropdowns (e.g. Country, City)

SPApi class

Allows performing custom JSOM calls

getUserProfile()

Allows quering Office 365 User Profiles. 

Please note this function requires extra permission.

addCustomButton()

Allows adding custom buttons to the top and bottom bars.

getFormContext()

Returns a formFontext object, holding basic information about the form.

openPanel() /  togglePanel()

Allows to open and toggle forms side panels.

saveForm()

Allows to save the form.

executeAction()

Allows to execute workflow action.

1. Get a Field Value – getValue()

Function Parameters:
fieldName (string)

What it does: Retrieves the value from a form field. The value type depends on the field type (e.g., text, number, user, date).

When to use it:

  • Check the value of a field before running actions.
  • Compare two fields.
  • Use in conditions.

When to use it

  • Read a field’s value to use in a condition.
  • Compare two fields.
  • Trigger actions based on a specific field.

Steps

  1. In your form, go to Logic → + Add a Rule.
  2. Choose Custom JS Function as the condition type.
  3. Paste your code and replace “Country” with the internal field name.

let country = getValue(‘Country’);

Example

Get the value of the “Country” field…

getValue('Country')
The value is case sensitive.

The return value type depends on the type of field that the function has been invoked for:

Field Type

Return Type (What you get back)

User (both single and multi-select)

Array of User

Lookup (single)

LookupItem

Lookup (multi)

Array of LookupItem

Date

Date

Choice (single)

String

Choice (multi)

Array of String

Currency/Number

Number

Text

String

URL

Url

Flag

 Boolean

2. Set a Field Value – setValue()

Function Parameters:
fieldName: the field to be set

What it does
Changes a field’s value programmatically.

When to use it

  • Auto-fill a field based on another.
  • Apply default values when conditions are met.
setValue() function allows to insert sublist items. Works exactly as insertSublistItems() function but instead of this function use setValue(). For more information about how insertSublistItems() works visit this article.

Example

Set the value of the “Shipping Costs” field…

let country = getValue("Country");

if (country == "England")
{
  setValue("ShippingCosts", "10")
}

getsetvalue.gif

3. Get Current User – getCurrentUser()

Function Parameters: None

What it does
Returns the details of the currently logged-in user.

When to use it

  • Auto-fill “Requester” or “Created By” fields.
  • Use user info in workflow logic.

Example

Get the details of the currently logged in user…

getCurrentUser()

 

4. Set Current User – setCurrentUser()

Function Parameters: fieldName: the field to be set

What it does : Inserts the currently logged-in user into a User field.

When to use it : Auto-assign the current user to a field.

Example

Set the details of the currently logged in user into the “User” field…

setCurrentUser('User')

getsetuser.gif

Sets the value taken from the “getCurrentUser()” function into a given field. Should be used with “User” field types. To allow for the “User” field type to receive an array of User object types, this function’s implementation is as follows: setValue(fieldName, [getCurrentUser()]); (note the square brackets around the 2nd parameter)

5. Set Current Date – setCurrentDate()

Function Parameters:
fieldName: the field to be set

What it does:  Sets a Date field to today’s date. 

Example

Set the Date Picker field to the current date…

setCurrentDate('DatePicker')


setdate.gif

Sets the value taken from the “getCurrentDate()” function into a given field.

6. Show a Custom Error – setErrorMessage()

Function Parameters:
fieldName: the field to be set
errorMessage: the error which will be displayed

What it does : Displays an error on a field.

Example

Set error message for the First Name field…

setErrorMessage("FirstName", "This is test ERROR");



7. ️⃣ Override Dropdown Options – updateLookupValues()

Function Parameters:
lookupFieldName: name of the lookup field
lookupValues: array of new lookup values that should be assigned to the lookup.

What it does : Replaces all options in a lookup/dropdown field. 

Example

let lookupFieldName = "Countries";
updateLookupValues(lookupFieldName, [{id: 1, value: "Country #1"},{id: 2, value: "Country #2"}]); 
This function overrides the dropdown content of the provided lookup field. It is meant to be used internally (by cascadingDropdowns function), so try to avoid using it in your custom logic).

8. Replace Choices with Images – replaceChoicesWithImages()

Function Parameters:
fieldName: name of the multi-choice or single choice radio buttons field
optionWrapperList: list with objects that define options replaced by images:
option: name of the option that will be replaced by the image
imageUrl: URL of an image that will be displayed instead of an option
width: width of an image (optional) – 50px by default
height: height of an image (optional) – 50px by default

What it does: Shows images instead of text for choice field options. 

Example

replaceChoicesWithImages('MultiChoiceFieldName', [  
      {
       option: 'Microsoft Edge', 
       imageUrl: 'https://s3.eu-west-1.amazonaws.com/sintel.workspace/DemoFormLogos/WebBrowserLogos/edge_64x64.png', 
       width: 64, 
       height: 64
   },
   {
       option: 'Chrome', 
       imageUrl: 'https://s3.eu-west-1.amazonaws.com/sintel.workspace/DemoFormLogos/WebBrowserLogos/chrome_64x64.png'
   }
])


9. ️⃣ Get User Properties – getUserProperties()

Function Parameters: propertyName: name of the property from user information list

What it does: Retrieves profile info for a user from the SharePoint user info list. 

Example 1

For properties that are allways return data (“Title”, “JobTitle”, “Department”, “Name”, “EMail”, “MobilePhone”, “WorkPhone”)

let user = getCurrentUser();

getUserProperties(user)
   .then(data => {
   setValue('Title', data.EMail);
    });

 2020-06-09_0410_001.png

Example 2

For other properties e.g: data.FirstName, data.LastName, data.UserName, data.Office data.OtherMail etc.

let user = getCurrentUser();
let properties = ["FirstName"];

getUserProperties(user, properties)
   .then(data => {
    setValue('Title', data.FirstName);
    });

 

2020-06-09_1212.png 

10. Get First Matching List Item – getFilteredFirstListItem() (aka VLOOKUP)

What it does: Finds the first matching item from another list. 

Function Parameters:

searchedValue: this is the value you are searching for (we support text, number or lookup field types)
targetListTitle: this is the internal name of the list you are attempting to search
targetListFieldInternalName: this is the column in the list where the “searchedValue” will be searched for
fieldsToBeReturned: these are the list columns to be returned from the list you are searching

The “fieldsToBeReturned” parameter should contain at least one field name. If there is an empty array passed, an empty result is returned. If a field that you provide in the fieldsToBeReturned array does not exist in the list, it will be skipped. In the below example, the parameter contains “Title”, “Role”, “LatestFilm” and “Oscar”.

Example

In the following example we will query a list and return the first matching item (the one with the lowest ID from the list), regardless of how many matching items are found. We will provide the list name to be searched, the field to search within and the other fields that we want to return data from.

let searchedValue = getValue('SearchedValue');
let targetListTitle = "FilmCrew";
let targetListFieldInternalName = 'Title';

getFilteredFirstListItem(searchedValue, targetListTitle, targetListFieldInternalName, ["Title", "Role", "LatestFilm", "Oscar"]).then(data => {
	setValue('Name', data.Title);
	setValue('Role', data.Role);
	setValue('LatestFilm', data.LatestFilm);
	setValue('Oscar', data.Oscar);
});


singleLogic.gif

11.Get All Matching List Items  – getFilteredListItems() (aka VLOOKUP)

What it does: Gets all matching items from another list. 

Function Parameters:
searchedValue: this is the value you are searching for (we support text, number or lookup field types)
targetListTitle: this is the internal name of the list you are attempting to search
targetListFieldInternalName: this is the column in the list where the “searchedValue” will be searched for
fieldsToBeReturned: these are the list columns to be returned from the list you are searching
operator: “equals” (default), “beginsWith”, “contains”.
itemsLimit: limit of items to be returned, default 0 returns all items.

The “fieldsToBeReturned” parameter should contain at least one field name. If there is an empty array passed, an empty result is returned. If a field that you provide in the fieldsToBeReturned array does not exist in the list, it will be skipped.

Example

In the following example we will query a list and return all the matching items. Again we will provide the list name to be searched, the field to search within and the other fields we want to return data from. The data that is returned will be populated into 4 multi-line text fields on the form and will be separated the newline escape sequence (\n).

let searchedValue = getValue('SearchedValue');
let targetListTitle = "FilmCrew";
let targetListFieldInternalName = 'Title'; 
let operator = "equals";//default 
let itemsLimit = 0;//default

getFilteredListItems(searchedValue, targetListTitle, targetListFieldInternalName, 
   ["Title", "Role", "LatestFilm", "Oscar"],itemsLimit, operator).then(data => {
	setValue('Name', data.map(d => d.Title).join('\n'));
	setValue('Role', data.map(d => d.Role).join('\n'));
	setValue('LatestFilm', data.map(d => d.LatestFilm).join('\n'));
	setValue('Oscar', data.map(d => d.Oscar).join('\n'));
});


2020-06-28_0420.png 

multiLogic.gif 

12. Cascading Dropdowns – cascadingDropdowns()

What it does: Makes one dropdown’s options depend on another. 

Function Parameters:

parentLookupFieldName: The field containing the parent lookup field (which the item id will be taken from)

childLookupFieldName: The field containing the child lookup field (the one which values will be filtered)

childLookupFilterFieldName (The field in child lookup that should be used to compare the parent id values)

Example A

Implement cascading drop-downs between Countries and Cities.
Assumptions:
a) there is a “Countries” list containing countries
b) there is a “Cities” list containing cities and a lookup to the “Countries” list (named CountryLookup)
c) within the main list (the one in which Sintel Forms is enabled – let’s call it “TestList”) there are 2 lookup fields in the main list “City” and “Country” fields that are linked to the “Countries” and “Cities” lists respectively

let parentLookupFieldName = 'Country';
let childLookupFieldName= 'City';
let childLookupFilterFieldName = 'CountryLookup';

cascadingDropdowns(parentLookupFieldName , childLookupFieldName, childLookupFilterFieldName);

2019-04-09_1429.png


Example B

Implement cascading dropdowns between Countries and Cities, but on a linked list level. Assumptions are similar to the ones above, but the “City” and “Country” fields are now located on a linked list named “TestList”  use display name of the linked list or its internal GUID.

let parentLookupFieldName = 'TestList.Country';
let childLookupFieldName= 'TestList.City';
let childLookupFilterFieldName = 'CountryLookup';

cascadingDropdowns(parentLookupFieldName , childLookupFieldName, childLookupFilterFieldName);

cascadinglookup.gif

Notes:
Allows to set up a cascading relation between dropdowns. Please note that when using a Rule to create cascading dropdowns, you should configure the “Run Once” flag on the Rule to optimise form performance.

Type Definitions

User

Field Name

Field Type

displayName

string

id

string

LookupItem

Field Name

Field Type

id

number

value

string

Url

Field Name

Field Type

description

string

url

string

13. SPApi class – Custom SharePoint Calls 

What it does: SPApi class allows writing custom JSOM queries by granting access to the SP.ClientContext and SP.Web objects.

Example

Use custom JSOM code to extract items from another SharePoint list and output them in console window


// ensureInitialized call is necessary to set up the class properly
SPApi.ensureInitialized();
const context = SPApi.context;
const web = SPApi.hostWeb;      

const anotherList = web.get_lists().getByTitle("AnotherList");
const camlQuery = new SP.CamlQuery();
const listItems = anotherList.getItems(camlQuery);

context.load(listItems, "Include(Id, Title)");      

context.executeQueryAsync(
	() => {  
  	const enumerator = listItems.getEnumerator();
    while (enumerator.moveNext()) {
    	const listItem = enumerator.get_current();
      
      const id = listItem.get_id();
      const title = listItem.get_item("Title");
      
      console.log("id: " + id + ", title: " + title);
   }
});
SPApi class is simply exposing the SP.ClientContext and SP.Web objects. In order to use them correctly, knowledge of building and running JSOM queries is required.

 

 14. Get User Profile – getUserProfile()

Microsoft 365 allows accessing user profiles from within your organization using your Microsoft 365 account. Sintel Forms offers a simple way of querying these user profiles through an API function called getUserProfile. You can perform various actions such as getting information from your own profile, another user’s profile, or that of their manager or direct reports.

In order to use this feature, you need to grant Sintel Forms a tenant level permission:  <AppPermissionRequest Scope="http://sharepoint/social/tenant" Right="Read" />.

To do this, you need to be a tenant administrator and then follow the steps:

    1. Navigate to https://[tenantName]-admin.sharepoint.com/_layouts/15/appinv.aspx.
    2. Paste “App Id” 9072e86e-1482-411c-8f5b-7cc4c997533c and click “Lookup”. The page should be reloaded and other fields prepopulated (it means the app was found).
    3. In the “Permission Request XML” field paste below XML:
      <AppPermissionRequests AllowAppOnlyPolicy="true"> 
          <AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="Manage" /> 
          <AppPermissionRequest Scope="http://sharepoint/social/tenant" Right="Read" /> 
      </AppPermissionRequests>
    4. Click “Create” and then “Trust It”.

Function Parameters:

user: SPUser field value, can be obtained via another API function getValue(‘Requester’)[0]; or getCurrentUser()

properties: list of user profile properties to be returned. This parameter is optional, and if not provided, the following properties will be returned: Account name, First name, Last name, Name, Work phone, Department, Title, Job Title, Manager, Picture, User name, Mobile phone, Work email, Home phone, Office, Office Location

Example

Within Sintel Forms Designer navigate to the Logic screen and then create a rule called “Get User Profile Data” as per the image below.

Create a Rule

In the Execute custom js function step, paste a function call as below to set fields:

let user = getValue('Requester')[0]; 
let properties = []; 
getUserProfile(user, properties).then(data => { 
    setValue('AccountName', data.AccountName); 
    setValue('FirstName', data.FirstName); 
    setValue('LastName', data.LastName); 
    setValue('FullName', data.PreferredName); 
    setValue('WorkPhone', data.WorkPhone);
    setValue('Department', data.Department); 
    setValue('Title', data.Title); 
    setValue('SPS-JobTitle', data["SPS-JobTitle"]); 
    setValue('Manager', data.Manager); 
    setValue('PictureURL', data.PictureURL); 
    setValue('UserName', data.UserName); 
    setValue('CellPhone', data.CellPhone); 
    setValue('WorkEmail', data.WorkEmail); 
    setValue('HomePhone', data.HomePhone); 
    setValue('Office', data.Office); 
    setValue('SPS-Location', data["SPS-Location"]); 
});

You can also output all the user profile data into a single multiline text field if you wish, consider a field called UserProfileData:

let user = getValue('Requester')[0]; 
let properties = []; 
getUserProfile(user, properties).then(data => { 
    setValue("UserProfileData", JSON.stringify(data));
});

Property

Sample data

AccountName

i:0#.f|membership|joe@sintelforms.com

FirstName

Joe

LastName

Bloggs

FullName

Joe Bloggs

WorkPhone

+ 353 862098762

Department

Sales & Marketing

Title

Marketing Specialist

SPS-JobTitle

Marketing Specialist

Manager

Array of data

PictureURL

https://tenant-my.sharepoint.com:443/User%20Photos/Profile%20Pictures/joe_sintelforms_com_MThumb.jpg

UserName

joe@sintel.ie

CellPhone

+ 353 862098762

WorkEmail

joe@sintel.ie

HomePhone

+ 353 862098762

Office

Cork

SPS-Location

Cork

15. insertSublistItems()

This function is described in more detail in this article.

16. addCustomButton()

Using this call, you can create custom buttons in your form, which will appear next to other buttons on the top panel of the form. You can find more details in this article.

17. Autocomplete – autocomplete()

This function gives the possibility to configure any text field to behave like an autocomplete control. Please note that autocomplete can also be used with Lookup fields by simply enabling it within the field properties pane in the layout screen of the Sintel Forms Designer.

Function parameter:

  • fieldName – text field name
  • minLength – the minimum number of characters typed in the text field that enables displaying suggestions list with possible results
  • dataSource
    • array of data with following format: { id: string, value: JSON object }
      • id – string value that is displayed in suggestions list for the user
      • value – JSON object that is used when user select an item from the suggestions list
    • API function with two optional parameters to use. The result should be returned as an array of data with a format like above. Optional parameters:
      • searchedValue – text value to be searched
      • resolveItems(items, createDataSourceId(item)) – the function transforms API array result to correct format that is acceptable in autocomplete control.
        • items – API array result.
        • createDataSourceId(item) – function that generate dataSource id property (value displayed as a result for user). User can combine here any text he wants to display, including API result item properties values.
  • select – a function that is triggered when the user selects an item from the suggestions list. The function input parameter is dataSource value (JSON object) from the selected item.

Example

Autocomplete using data from other list

autocomplete('Title', 1, 
    function(searchedValue, resolveItems) {
        return getFilteredListItems(searchedValue, "Users", "FirstName", ["ID", "FirstName", "LastName", "City", "SintelFormsStatus"], 0, "beginsWith")
            .then(data => resolveItems(data, (item => item.FirstName + ' ' + item.LastName)));
    },
    function(item) {
        setValue('FirstName', item.FirstName);
        setValue('LastName', item.LastName);
        setValue('City', item.City);
        setValue('UserStatus', item.SintelFormsStatus);
    }
);

Autocomplete with hardcoded data

autocomplete('Car', 1, 
    [
        { id: 'Volkswagen Golf (G)', value: { name: 'Volkswagen Golf', fuel: 'Gasoline', pricePerDay: 95 } },
        { id: 'Volkswagen Golf (D)', value: { name: 'Volkswagen Golf', fuel: 'Diesel', pricePerDay: 100.99 } },
        { id: 'Volkswagen Passat (G)', value: { name: 'Volkswagen Passat', fuel: 'Gasoline', pricePerDay: 119.99 } },
        { id: 'Volkswagen Passat (D)', value: { name: 'Volkswagen Passat', fuel: 'Diesel', pricePerDay: 125.49 } },
        { id: 'Volkswagen Tiguan', value: { name: 'Volkswagen Tiguan', fuel: 'Diesel', pricePerDay: 140.50 } },
        { id: 'Volkswagen Tuareg', value: { name: 'Volkswagen Tuareg', fuel: 'Gasoline', pricePerDay: 190.49 } },
        { id: 'Fiat 500', value: { name: 'Fiat 500', fuel: 'Gasoline', pricePerDay: 70.49 } },
        { id: 'Fiat Panda', value: { name: 'Fiat Panda', fuel: 'Gasoline', pricePerDay: 65.99 } },
        { id: 'Daewoo Tico (G)', value: { name: 'Daewoo Tico', fuel: 'Gasoline', pricePerDay: 15.99 } },
        { id: 'Daewoo Tico (L)', value: { name: 'Daewoo Tico', fuel: 'LPG', pricePerDay: 10.99 } },
        { id: 'Volvo S60', value: { name: 'Volvo S60', fuel: 'Gasoline', pricePerDay: 125.99 } },
        { id: 'Volvo V60', value: { name: 'Volvo V60', fuel: 'Gasoline', pricePerDay: 150.99 } },
        { id: 'Volvo XC40', value: { name: 'Volvo XC40', fuel: 'Gasoline', pricePerDay: 175.99 } },
        { id: 'Opel Corsa', value: { name: 'Opel Corsa', fuel: 'Gasoline', pricePerDay: 70.99 } },
        { id: 'Opel Astra', value: { name: 'Opel Astra', fuel: 'Gasoline', pricePerDay: 85.99 } },
        { id: 'Opel Insignia', value: { name: 'Opel Insignia', fuel: 'Gasoline', pricePerDay: 115.99 } },
        { id: 'Ford Mustang', value: { name: 'Ford Mustang', fuel: 'Diesel', pricePerDay: 449.99 } }
    ],
    (item) => {
        setValue('Car', item.car);
        setValue('FuelType', item.fuel);
        setValue('PricePerDay', item.pricePerDay);
    }
)

For more about autocomplete please visit our blog.

18. Get From Context – getFormContext()

This function returns an object holding helpful data about the current form. It has the following properties:

  • listDisplayName: SharePoint title of the current list
  • listInternalName: SharePoint internal name of the current list
  • formViewUrl: URL that can be used to open up form viewer for this item in a “view” mode
  • formEditUrl: URL that can be used to open up form viewer for this item in an “edit” mode
  • formCreateUrl: URL that can be used to open up form viewer for a new item
const formContext = getFormContext();

console.log("listDisplayName: " + formContext.listDisplayName);
console.log("listInternalName: " + formContext.listInternalName);
console.log("formViewUrl: " + formContext.formViewUrl);
console.log("formEditUrl: " + formContext.formEditUrl);
console.log("formCreateUrl: " + formContext.formCreateUrl);

19. Show Message –  showMessage()

Function show a popup message in the top right corner.

The function should take 2 params:

  • message – a text to be displayed
  • type (optional) – a type of a message; available types: info (applied by default), success, warning, error, default.

Example

showMessage("This is a secret message!", "success")

20. Open or Toggle Penel – openPanel() / togglePanel()

Functions allow to open and toggle forms side panels.

They have two parameters:

  • panelName – allowed values: “conversations”, “workflow”, “attachments”, “external sharing”
  • listId – list guid / internal name / title (optional)

Example

addCustomButton("Open conversations", "Brightness", function() { openPanel("conversations", "Test List")});

Example II

addCustomButton("Open conversations", "Brightness", function() { togglePanel("conversations", "Test List")});

21. Save Form – saveForm()

The function allows saving the form. Here you can find a use case for this function.

22. Execute Action – executeAction()

The function allows executing the action on the form. Here you can find more information.

The function has one parameter:

  • actionId – workflow task id
Was this article helpful?
0 out of 5 stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.
Table of Contents

Sintel Apps

Create apps on Microsoft 365 in minutes with no code.

Address

River House
Blackpool Park,
Cork, T23 R5TF,
Ireland

Support

  • Product help
  • Community site
  • Submit a ticket
  • Compare us

    Contact us to

    • Book a demo
    • Request a license
    • Become a partner

    e-mail: info@sintelapps.com
    tel: +353 (0) 21 245 2935

    Follow us

    • Follow
    • Follow
    • Follow

    © Copyright 2026 | End User License Agreement | Privacy Policy | Terms Of Use

    Sintel Apps
    Sintel Apps Assistant
    Get instant answers and support
    Connecting to Sintel Apps Assistant…
    Sintel is thinking…
    We use cookies to collect and analyse information about the users of this website. Please click 'I accept' to consent to the use of this technology.