Using Decision Activity

  • 148 Views
  • Last Post 14 February 2020
  • Topic Is Solved
Parth Bakshi posted this 13 February 2020

The decision activity doesnt accept a comparison to null?

Or am I doing it wrong

It doesnt even accept any .net scripting, I am trying to identify the length of a string variable and it gives me an error

 

Attached Files

Order By: Standard | Newest | Votes
alphonsa@intellibot.io posted this 13 February 2020

Hi Parth,

 

In Decision component you will not be able to use .net code, you can use Script component for .net code and return the parameters as required. In this case you can directly return the length of the string in Script component itself and use that output in Decision component to validate. Otherwise, you can change your automation as per below screenshot.



Thanks & Regards,

Alphonsa.K

 

 

Parth Bakshi posted this 14 February 2020

The point here is to check if a string is null or not, if yes then do 1 else do 2

So even a null comparison doesnt work. And the decision should ideally work like an if statement taking any code right? This is unnecessarily increasing the complexity of the program. Anyway, any idea on how to check for the above issue?

alphonsa@intellibot.io posted this 14 February 2020

Hi Parth,

As you mentioned, you are trying to identify the length of a string we have suggested the above solution. And also as i mentioned in earlier component Decision is not for scripting, please refer to the documentation (Decisionfor more information on Decision component.

 Now coming back to your point, if you wanted to check whether string is null or not you can use IsNullOrEmpty" or "IsNullOrWhiteSpace" components under StringUtilities section, please refer to the below screenshot for your reference.



FYI, As you're already using script component you can also validate the output string in Script component itself and return boolean (True/False) and use that Boolean in Decision component to design the flow accordingly which simplifies more if this suits as per your requirement.

Thanks & Regards,

Alphonsa. K

Parth Bakshi posted this 14 February 2020

Thank you for the clarification

  • Liked by
  • alphonsa@intellibot.io
Close