Back

Prevent Post-Integration Tasks from running when there are no records

Published: Nov 04, 2024
Post Author Written by Trey Dew

When running an integration on a schedule or manually there may be times where there isn’t any data in the data source. You may also have post integration tasks that update variables or send an email. If you don’t want these tasks to run when there is no data in the source, you can set up this simple task.

Prefer a video explanation? Click here.

One option is to uncheck the “Return map Success” and “Return map Failure” on the Options tab of the map. If they are unchecked, the post integration tasks shouldn’t run.one more 1
If you are unable to uncheck the “Return map Success” and “Return map Failure” options, then follow these steps to stop the tasks from running when there is no data in the source.

Open the integration and navigate to the Tasks tab to a add a new task

  1. In the Tasks tab of the map, right click on “Tasks that run if the Integration fails” or “Tasks that run if the Integration succeeds” and create a new Run Script task.
    • If you are unsure on which option to put the new task on, you can check under Options to see what happens if there is no data returned from the maps data source
      tasks
      taskss
  2. You can name this task whatever you like, then change the On Fail drop down to the “Cancel Processing” option. Then in the Script Code enter the code below. You can get the GlobalSuccessCount from the Global Variables -> System Variables.
    if(GlobalSuccessCount > 0)
    return true
    else
    return false
    end if

    tasksss
  3. Once you have created the task, make sure it runs before any other tasks. You can do this by using the arrows in the bottom right to move it to the top of the list.
  4. Save the new Task and the map.
  5. Now when you run the integration when no data is present the Post Map tasks won’t run.

This process is a bit easier on smartconnect.com as there is an option to disable tasks if no data was returned

  1. Navigate and open the integration you want to apply this to.
  2. Find the Options Tab, find the If Blank Lines in Data source line and select the Dont run any tasks option.
    tasks.com

Have questions about disabling Tasks in SmartConnect or other solutions? Feel free to send us an email at support@eonesolutions.com

Feeling stuck? Get the support and guidance you need to help you power through any data challenge

We're on your integration team. Connect with our people and let us know how we can help you.