Setting & clearing field values using rules

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. 

 

  1. 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

     

  2. Lookup (single)
    setValue("FieldName", null)
    
  3. Lookup (multi)
    setValue("FieldName", [])
    
  4. Date (with and without the time part)
    setValue("FieldName", null)
    
  5. Choice (single)
    setValue("FieldName", null)
    
  6. Choice (multi)
    setValue("FieldName", [])
    
  7. URL/image
    setValue("FieldName", null)
    
  8. Currency/number
    setValue("FieldName", "")
    
  9. Text
    setValue("FieldName", "")
    

 

Was this article helpful?
0 out of 0 found this helpful