How to check if a string variable is empty?

Status
Not open for further replies.

Mark Phillips

Customer
Advanced Certified
Joined
Jan 28, 2019
Messages
154
Reaction score
53
Hi All
I have a string parameter defined as follows:
Code:
<Parameter Name="AllowedQueues" Type="String" Parent="Call Reporting" Editor="String" Title="Journal calls handled by these queues" />

I am trying to test for it being empty in an scenario's SkipIf:
Code:
<Request SkipIf="[[AllowedQueues].Equals(&quot;&quot;)]==True"

I have also tried:
Code:
<Request SkipIf="[AllowedQueues]==&quot;&quot;

And other variations, none of which cause the scenario to be skipped when [AllowedQueues] doesn't contain any data.

However,
Code:
<Request SkipIf="[[AllowedQueues].Equals(&quot;ABC&quot;)]==True"
and
Code:
<Request SkipIf="[AllowedQueues]==&quot;ABC&quot;
works fine when [AllowedQueues] contains the string ABC.

Any ideas?
Thanks
Mark
 
I would use 0 as "none" and use the ==0 SkipIf value.
 
  • Like
Reactions: TheodorosG_3CX
Just guessing here, but maybe the parameter is null instead of an empty string, and that's why the comparison against an empty string is false. Can you try adding an empty string as default value for the parameter?
<Parameter Name="AllowedQueues" Type="String" Parent="Call Reporting" Editor="String" Title="Journal calls handled by these queues" Default="" />
 
Status
Not open for further replies.

Forum statistics

Threads
112,322
Messages
591,889
Members
165,470
Latest member
Robert Lee