How Can We Help?

Search for answers or browse about Sintel Forms.

Set & clear field values using rules

You are here:

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 the Sintel Forms Designer Logic->Rules->Steps.

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", [])

 

If you are trying to set the Person field using the logic rules, it requires both the name of the user and their email address. The “InternalFieldName” will be the field that you are trying to set.

To clear the Person field, place two empty brackets after the field name.

Lookup (single)

Set it…

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

Clear it…

setValue("InternalFieldName", [])

 

Please note that Lookup values are identified by their ID and not their title.

 

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.5 out of 5 stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 100%
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.
Table of Contents