Question T5777
Visible to All Users

Is there any way for us to do the same process and limit the options of conditions that are available?

created 4 years ago (modified 4 years ago)

[Ticket cloned from T5761: limiting the surveyJS logic options]

hello,

We also have another question.

Is there any way for us to do the same process and limit the options of conditions that are available?

Define condition(s)

We ideally only want to allow 'equals' within the conditions, however there does not seem to be an object to interact with for this?

I would assume it would be something like this:

Code
SurveyJSCreator.SurveyLogic.visibleConditions = ["equals"];

But that did not seem to work

Advice appreciated

Frank
Havuta.com

Answers approved by surveyjs Support

created 4 years ago

Hello Frank,

All available condition options are listed within the operators static property of the SurveyPropertyEditorFactory class: SurveyCreator.SurveyPropertyEditorFactory.operators

See the list of conditions in our source code:
https://github.com/surveyjs/survey-creator/blob/master/packages/survey-creator/src/propertyEditors/propertyEditorFactory.ts#L10-L23

To limit options to the equals condition only, you can set the operators property as the following code demonstrates:

JavaScript
SurveyCreator.SurveyPropertyEditorFactory.operators = {equal: ["!file"]};

Thanks,
Andy