Conditions and operators in the script

Hello, I need to display a popup with information for the user, but only if a certain value is selected in the Dropdown type item. I have written a script in the Change Model section as follows:

if (doo.model.resultVisit.value === ‘Other’)
doo.alert.showInfo(“Warning visit result: Other”, “Describe the result in more detail in the comments”)

However, with the script written this way, the popup is displayed every time a change is made, including successively entering text in the Note field - I understand the reason :slight_smile: So apparently I need to modify the condition so that the popup appears only when the value is selected and at the same time the Note field is empty - and that’s it. I tried to write the script a little differently - see below, but the window does not appear at all in this case - can you please advise me how to do this?

if (doo.model.resultVisit.value === ‘Other’ && doo.model.remark.value === null) doo.alert.showInfo(‘Comment on the result of the visit: Please describe the result of the visit in more detail in the comment’)

Thank you very much :slight_smile:

Hi Milan,

try this:

if (doo.model.resultVisit.currentlyChanged && doo.model.resultVisit.value === 'Other') {
    doo.alert.showInfo('Warning visit result: Other', 'Describe the result in more detail in the comments');

Hello Jan, thanks a lot for the advice - it works as I wanted :slight_smile:


1 Like