Hello Bart,
Thanks for providing the requested details. I have debugged the script and found out that the issue seems be with the report query itself around line 99 where the campaignNameContains is set to empty. When you set a WHERE clause to compare with an empty variable, it won't be just ignored. The report query will run with the conditions you set. You can test the issue out on your end by copying lines 99-110 into a new script. Declare the variables campaignNameContains, whereStatements, and activeCampaignIds, then remove the WHERE clause and replace "AND" with "WHERE". It will log the same message if it did not capture any campaigns and you may add an else statement to see it if captured campaigns.
With the way that the script was coded, I would suggest that you remove line 102 and write another if statement before line 90 that would look like below code. This will check if you have set anything in the campaignNameContains variable (line 27), otherwise the report query will not work as intended.
if (campaignNameContains != "") {
whereStatements += "AND CampaignName CONTAINS_IGNORE_CASE '" + campaignNameContains + "' ";
}
Let me know how it goes or if you have questions.