How Can We Help?

Search for answers or browse about Sintel Forms.

Default values & custom values

You are here:

Sintel Forms allow you to set up default values on form fields and two types of default values are supported:

  1. Standard SharePoint default values
  2. Custom default values within Sintel Forms
Standard SharePoint default values

Sintel Forms supports any default values that are set on a SharePoint list field. This means that a when a new form is created any fields in the list that contain a default value will display that value.

To ensure that a field on a form is using a default value from SharePoint, you simply need to verify the “Default value” setting within the Layout screen of the Sintel Forms Designer is set to “Inherited from SharePoint”. Note that this is the default setting.

ShPdefaultValueSetting.png

As shown above, a hint will appear under the setting which will show the default value that is defined for the field within the SharePoint list.

SharePoint default values are not the same as SharePoint default formulas – SharePoint default formulas are not supported.
Custom default values within Sintel Forms

Using a custom default value allows you to define more complex default values and additionally allows you to apply default values to field types that do not support default values in SharePoint out of the box. The additional fields that Sintel Forms supports default values with are:

  1. Multiple Lines of text
  2. Lookups (both single and multi-select)
  3. Person or group (both single and multi-select)

To make sure that a field is using a custom default value, make sure that it has the “Custom” value set in “Default value” setting. You can then enter the default formula.

CustomDefaultValueSetting.png

Similar to Calculated Fields, Custom default values can handle any JavaScript expression. For example, you can put a [“Hello”, “World”, “!”].join(” “) expression inside a default value formula. It will populate the field with the result of that expression, which will be “Hello World!”.

It is also possible to use following functions when defining a custom default value:

  1. getCurrentUser()

    Returns information about the current user. Can be used in people picker fields or in text fields.

    Example

    1. Set current user in people picker field

      getCurrentUser()

    2. Set current user’s name in a text field

      getCurrentUser().displayName

    3. Set current user’s email in a text field

      getCurrentUser().emailAddress

  2. today() Returns today’s date and time
    This default values can be used with ‘Date and time’ fields type – both including and excluding time.

    Example

    1. Set today date with a current time

      today()

    2. Set tomorrows date with current time

      today().add(1, ‘days’)

    3. Set next month with current time

      today().add(1, ‘month’)

    4. Set next year with current time

      today().add(1, ‘year’)

    5. Set midday in day after tomorrow

      today().add(2, ‘days’).startOf(‘day’).add(12, ‘hours’)

    today() function uses momentjs syntax – see momentjs page for more examples on manipulation and formatting.

More sample formulas

Text fields

   - "Hello!" (static string)
   - "Hello, " + getCurrentUser().displayName + "!" (combined strings)

Number fields

   - 123 (static number)
   - 123 * 10 (any numeric operation)

Flag fields

   - 0 (static numeric value)
   - true (static js boolean value)

User fields 

   - getCurrentUser() (helper function)
   - "user@domain.com" (static email text)
   - ["user@domain.com", "user2@domain.com"] (array of users - for multi-value people pickers)
   - [getCurrentUser(), "user@domain.com"] (array of users, including helper function)

Choice fields

   - "Value one" (static text with a single value)
   - ["Value one", "Value three"] (array of static texts - for multi value choice fields)

Date/DateTime fields

   - new Date(2013,10,10, 11, 59) (static datetime value)
   - new Date().getFullYear() - for add a current year into an e.g. single line text
   - today() (helper function)
   - today().add(1, 'month')

Lookup fields

   - 1 (id of the lookup item)
   - [1,2] (array of ids of lookup items - for multi-value fields)

Default values in sublists

It is also possible to use default values (both SharePoint-based or Custom), within fields in a sublist. This can be done within the Sintel Forms Designer by selecting the relevant field in the sublist and configuring the default value.

CustomDefaultValueSetting.png

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