Functions available:
Code Block |
---|
|
this.allowSubmit(Boolean)
this.changeFormValue(field_name, new_value)
this.enableField(field_name, Boolean)
this.disableField(field_name)
this.mandatoryField(field_name, Boolean)
this.changeInputValue(field_name, value)
let value = JSON.stringify(finalValues)
this.updateAnnotations(value)
let errorMsgs = []if(errorMsgs.length > 0) {
this.displayErrors(errorMsgs)
this.disAllowSubmit(true)
} else {
this.disAllowSubmit(false)
}
this.changeAnnotationClasses(newClass);
let inputText = inputValues[field_name]
let currentUserId = localStorage.getItem("userId")
if(currentUserLevel === 1) {
this.changeFormValue(field_name, `${currentUserId}`)
}
For NER:
let entities = _.get(annotations, "[0].value.annotations.entities", _.get(annotations, "annotations.entities", []))
To access form values in On-Change/on-Validation/On-save(also console the values coming from values and formValues then use as required):
let fieldNameValue = formValues["field_name"] |
Examples:
Audio transcription validation: No special characters allowed, tags validations, etc.
...
Code Block |
---|
let intentValue = values["Field_name"]
if (intentValue == "Field_name")
{
this.enableField("Field_name",tID)
this.enableField("Field_name",tID)
this.mandatoryField("Field_name",true,tID)
this.mandatoryField("Field_name",true,tID)
}
else if (intentValue == "Field_value" || intentValue == "Field_value" || intentValue == "Field_value" || intentValue == "Field_value" || intentValue == "Field_value" )
{
this.disableField("Field_name",tID)
this.disableField("Field_name",tID)
this.changeFormValue("Field_name", " ",tID)
this.changeFormValue("Field_name", " ",tID)
} |
16. Excel View validations and manipulations:
Code Block |
---|
|
let intentValue = values["Field_name"]
if (intentValue == "Field_name")
{
this.enableField("Field_name",tID)
this.enableField("Field_name",tID)
this.mandatoryField("Field_name",true,tID)
this.mandatoryField("Field_name",true,tID)
}
else if (intentValue == "Field_value" || intentValue == "Field_value" || intentValue == "Field_value" || intentValue == "Field_value" || intentValue == "Field_value" )
{
this.disableField("Field_name",tID)
this.disableField("Field_name",tID)
this.changeFormValue("Field_name", " ",tID)
this.changeFormValue("Field_name", " ",tID)
} |