Skip to main content
Solved

Workflow Expression != null

  • November 17, 2024
  • 9 replies
  • 273 views

Forum|alt.badge.img+10

I have a condition on my or gate, when value is not null then …

The condition is not respected, any idea why please?

 

 

 

Thank’s in advance

Best answer by dsj

Hi ​@IFSRUNINNOVAL 

I usually do the validations in a script before reaching the gate. it helps to build complex validations and keep the gate conditions clean, and work :D

 

For your scenario, use a script like this

 

In the gate, use the isValid variable as the condition

 

Valid path:

Invalid path

Hope it helps!

Damith

9 replies

Forum|alt.badge.img+10
  • Author
  • Hero (Customer)
  • 122 replies
  • November 17, 2024

have also tried the below, but it didn’t worked : 

 

if (execution.getVariable('DiscountAmount') !== null) {
true;
} else {
false;
}

 


Forum|alt.badge.img+10
  • Author
  • Hero (Customer)
  • 122 replies
  • November 17, 2024

I made a simple workflow to test manually and i’m having the same problem

 


Forum|alt.badge.img+10
  • Author
  • Hero (Customer)
  • 122 replies
  • November 17, 2024

@dsj ​@kamnlk ​@Lahirumala de Mel  if you have any ideas i will be greatfull 

 

 

Thank’s in advance 


Forum|alt.badge.img+9
  • Hero (Employee)
  • 137 replies
  • November 18, 2024

Hi ​@IFSRUNINNOVAL ,

I quickly tried this scenario, and it seem to work for me

 

 

what it the condition you have for the other branch of that gateway ? if that is also true for this variable value that could cause issues with picking up the correct path to follow 

 

there is another alternative syntax you can use for expressions in these scenario 

${execution.getVariable("demoAmount") != null}

 


Forum|alt.badge.img+10
  • Author
  • Hero (Customer)
  • 122 replies
  • November 18, 2024

@kamnlk and if you try demoAmount with no value will it work also please?

already tried the Execution.getVariable :/ 


Forum|alt.badge.img+9
  • Hero (Employee)
  • 137 replies
  • November 18, 2024

Hi ​@IFSRUNINNOVAL ,

Yes it should also work in that scenario as well 

 

scenario1: variable is not declared

 

scenario 2 : variable value is null 

 


Forum|alt.badge.img+10
  • Author
  • Hero (Customer)
  • 122 replies
  • November 18, 2024

thank you ​@kamnlk mabey it’s related to my environment :/


dsj
Ultimate Hero (Partner)
Forum|alt.badge.img+22
  • Ultimate Hero (Partner)
  • 905 replies
  • Answer
  • November 18, 2024

Hi ​@IFSRUNINNOVAL 

I usually do the validations in a script before reaching the gate. it helps to build complex validations and keep the gate conditions clean, and work :D

 

For your scenario, use a script like this

 

In the gate, use the isValid variable as the condition

 

Valid path:

Invalid path

Hope it helps!

Damith


Forum|alt.badge.img+10
  • Author
  • Hero (Customer)
  • 122 replies
  • November 18, 2024

@dsj thank’s.

Good idea!