How Can We Help?

Set & clear field values using rules

You are here:
< All Topics

The setValue function within our JavaScript API allows you to set or clear any value on a form field. This function can be used within Steps that you can add to Rules on the Logic section of the Sintel Forms Designer

Below you will find code snippets for setting and clearing a field value for different field types.

 

User (both single and multi select)

Set it…

let user ={displayName: "Joe Bloggs", id: "joebloggs@example.com"}
setValue("InternalFieldName",[user]);

Clear it…

setValue("InternalFieldName", [])

 

Rule To Set People Picker Field

 

Rule To Clear People Picker Field

 

Lookup (single)

Set it…

setValue("InternalFieldName",ID of the lookup item)

Clear it…

setValue("InternalFieldName", [])

 

RuleToSetSingleLookupField.png

 

RuleToClearSingleLookupField.png

 

Lookup (multi)

setValue("FieldName", [])

Date (with and without the time part)

setValue("FieldName", null)

Choice (single)

setValue("FieldName", null)

Choice (multi)

setValue("FieldName", [])

URL/image

setValue("FieldName", null)
setValue("Url", {description: "Test", url: "https://www.test.com"})

Currency/number

setValue("FieldName", "")

Text

setValue("FieldName", "")

 

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?
Table of Contents