So I’ve got a for each loop for IDs to run a query - it’s one query and then another query, but only one of them will work with the relevant ID, so in the flow I have one following another, with Continue on Error= True if the Execute query of either ID fails.
I have to append the results to a sheet though, and if the first query is not successful and continuing on error, there is nothing to append, so I am wondering is there a way to continue on error for the append range activity similar to execute query activity.
Or else within an if statement - if the execution is successful, then append - but I can’t get a statement for this IF to work eg: POST_DT.IsNullOrEmpty(POST_DT) ; or something similar.
Hi @Kyleb91,
You won’t get any errors while executing the execute query with an irrelevant ID. Instead of an error you will get an empty datatable as an output. So, by just checking the output datatable row count will help you solve this problem. If rows.count is <=0 then there is nothing to append.
Hi guys - could someone please have a look at this workflow for the above; it doesn’t seem to work - it runs fully when debugged but the IDs in the Variable of ‘EDD_text’ are not running accordingly and appending nothing in my excel.
What I’d like this to do is look in EDD_Text VAR and find the IDs, and then loop through each accordingly depending on what Data script it should be run - in this example, the 123456 should be run for BF. and then the PP IDs should then be attempted to be ran in the scripts and output appended.
both the approach will work fine together
like the sequence be like this
–use FOR EACH loop and inside the loop use TRY CATCH ACTIVITY only for that query activity and if id is passed for each iteration it will get into the query inside TRY where next to this query activity use a assign activity like this bool_queryerror = False
where bool_queryerror is a variable of type boolean with default value as False defined in the variable panel
–if that works fine it will go through try block alone
–if that doesnt work it will go to CATCH block where we can use a assign activity like this bool_queryerror = True
–now next to this TRY CATCH activity, ie., outside to this use a IF condition like this bool_queryerror = False
if true it will go to THEN part where we can use APPEND RANGE ACTIVITY or goes to ELSE part where we can leave it empty so that it wont append any range to the excel
Hi guys - could someone please have a look at this workflow for the above; it doesn’t seem to work - it runs fully when debugged but the IDs in the Variable of ‘EDD_text’ are not running accordingly and appending nothing in my excel.
What I’d like this to do is look in EDD_Text VAR and find the IDs, and then loop through each accordingly depending on what Data script it should be run - in this example, the 123456 should be run for BF. and then the PP IDs should then be attempted to be ran in the scripts and output appended.