- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2022 08:10 AM
In a Discovery Pattern, how can I check if a Table has 0 results?
Steps:
1) Parse a file and store the results in a Table. Se
2) Use a Match operation to check if an array/table has 0 results. Stop execution of the pattern extension if there are no results.
I tried this, but it does not work as expected. Only if the
Operation: Match
$_rnr_scheduled_tasks_ is Empty
I've also tried:
$_rnr_scheduled_tasks_[] is Empty
and
$_rnr_scheduled_tasks_[*] is Empty
None of these conditions cause the Pattern to gracefully exit. Any idea on how to proceed?
Solved! Go to Solution.
- Labels:
-
Discovery

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 07:50 AM
Oh, alright, my bad, i sometimes am a bit slow.
I never had to do that before, but my guess is, that you could check for the first line in your table to be present. Could you check if
$_rnr_scheduled_tasks_[1]."some_column" is Empty
works? Ideally use a column that is always filled. The issue here is, that - as far as i understand patterns - the "isEmpty" only checks for the string based value of a variable. This means any table with columns - no matter if they have an value - is no longer empty (this at least is my interpretation of why it may not work in your case).
Also sorry for my daylong wait, i don't get notifications in time by the community at the moment...
Regards
Fabian

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 07:50 AM
Oh, alright, my bad, i sometimes am a bit slow.
I never had to do that before, but my guess is, that you could check for the first line in your table to be present. Could you check if
$_rnr_scheduled_tasks_[1]."some_column" is Empty
works? Ideally use a column that is always filled. The issue here is, that - as far as i understand patterns - the "isEmpty" only checks for the string based value of a variable. This means any table with columns - no matter if they have an value - is no longer empty (this at least is my interpretation of why it may not work in your case).
Also sorry for my daylong wait, i don't get notifications in time by the community at the moment...
Regards
Fabian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2022 07:04 AM
Thanks for that. Checking to see if a column is empty is a viable option for me, so that will work.
And I think you're spot on that "isEmpty" only checks for the string based value of a variable.
I'll go with your suggestion and if I need to get more precise, I can do something with Eval().
Your help is greatly appreciated! Thanks