Use {CALL:x} in Constraints

Hi @emre

Can we use the result of a {CALL:x} as a Constraint for an Action?

The {Call:x} definitely returns a ‘Ok’ if the Script runs to the end using a return 'Ok' ; but for some reason the constraint must always evaluate to true i.e. Do not do action?

Note: I have tried placing Quotes around the {Call:x} and also used != 'Ok'
Advice please…

IIRC, you can use it in constraint. I think I did return 1==2 if I don’t want to run the action.

Hi @sukasem

Do did you enclose the Call with quotes like ‘{CALL:x}’ == ‘2’ or just use {CALL:x} == 2?

Just do the whole thing in script and return from script 1==1 or 1==2

So, constraint field is {CALL:my.script (‘var1’,‘var2’)}

1 Like

Yep doing that but for some reason the constraint always returns True i.e. do not do action…

Ah crap hang on a minute sukasem it seems the Update Rule is not Updating the field! Opps my issue I think.
Should be {:IVSupplierID} not {:IVSupplierNo} :scream:

Will test now…

Yes confirmed my issue - you can use {CALL:x} as a constraint where the Script returns a Good or Bad value to constrain the Rule Action.

Thanks for confirming @sukasem.

1 Like

Action level constrain a bit tricky. All constraints in the rule will be evaluated first all of them before even the first action start. It does not evaluation one by one. So, think about the flow carefully.