Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
5951 Widoki

Hello Community,

I stumbled over the following. I have an input named BNS (for bonus).

And I have a Phyton condition: result = inputs.BNS.amount > 0

and I tried the second version of it: result = inputs.BNS.amount is not None 

Based on whether it is true the calculation should activate. 

When there is an BNS input in a payroll slip, everything works. If there is no BNS input, i get the error in subject. Please, advise how to skip this rule execution when there is no BNS input

Awatar
Odrzuć
Najlepsza odpowiedź

Hello,

You can use try and except

example

try:

     result = inputs.BNS.amount
except:

     result = 0

Awatar
Odrzuć
Najlepsza odpowiedź

Hi

make the conditions based on = always true

computation:

Amount Type = python code

python code = result = inputs.BNS1.amount * 1


and in the inputs tap add

description= Bounce

Code= BNS1


Hope that help


Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
maj 25
1250
1
mar 25
1281
0
lut 25
1523
1
gru 24
1917
0
lis 24
108