Network Automation Software We are currently migrating this forum
over to our HelpSystems domain. Please
post all new threads in our new
HelpSystems Community Portal.
Post to the HelpSystems Forum
You are not currently logged on. You must be logged on in order to post. Log on
Or Create a new account
AutoMate Discussion
Decrease font size
Increase font size
Topic Title: Len(%variable%) > 0 is always true on a NULL value
Topic Summary:
Created On: 07/21/2017 07:44 AM
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
View similar topics View similar topics
View topic in raw text format. Print this topic.
 07/21/2017 07:44 AM
User is offline View Users Profile Print this message

Author Icon
JonBrown
Student (5-19 posts)

Posts: 11
Joined: 12/02/2005

Right now I have a dataset. Before I would check a NULL value if the with a len() > 0 type of function. This makes it simple because I don't have to add any more columns to my dataset to base the if statement off of. Below is a sample code. These always return true when the variable contains a NULL value.

This worked fine in version 10. After the switch to 11, it exhibits the above behavior.

Any suggestions?


Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)
 07/21/2017 01:00 PM
User is offline View Users Profile Print this message

Author Icon
JeffTysco
Artisan (200-499)

Posts: 319
Joined: 07/30/2009

Have you tried the IsNull (and/or IsEmpty) function in place of len?

-------------------------
?? . Your Total IT Solutions Provider
?? . Business Class Hosting Services
 07/21/2017 01:22 PM
User is offline View Users Profile Print this message

Author Icon
JonBrown
Student (5-19 posts)

Posts: 11
Joined: 12/02/2005

How would you check for NOT Isnull(%variable%) like this?


Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)
 07/24/2017 10:45 AM
User is offline View Users Profile Print this message

Author Icon
Alex Escalante
HelpSystems

Posts: 871
Joined: 02/26/2014

Hello Jon,

One workaround to accomplish your goals is to use an "if statement" and compare your data value against an empty variable.

We understand you would like to use the expression better, but this may be used as an alternative.


Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)


-------------------------

Alex Escalante | Support Analyst
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700 | F: +1.213.738.7665
 05/23/2018 07:14 AM
User is offline View Users Profile Print this message

Author Icon
RobertFarkas
n00b (>6 posts)

Posts: 2
Joined: 06/25/2014

v11.0.2.22:

IF %dataset.columnvalue% = 1 will also return TRUE even if dataset.columnvalue is NULL.

Argh.
 05/29/2018 09:08 AM
User is offline View Users Profile Print this message

Author Icon
Devin Cannon
HelpSystems

Posts: 398
Joined: 03/17/2016

Hi Robert,

I wasn't able to reproduce this here. How are you generating the dataset?

-------------------------

Devin Cannon | Support Analyst
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700 | F: +1.213.738.7665
Statistics
18258 users are registered to the AutoMate Discussion forum.
There are currently 0 users logged in.
The most users ever online was 5551 on 01/08/2018 at 11:11 AM.
There are currently 746 guests browsing this forum, which makes a total of 746 users using this forum.

FuseTalk Enterprise Edition v4.0 - © 1999-2019 FuseTalk Inc. All rights reserved.

Sitemap Network Automation Software Blog