Jump to content
  • 0

Only Send Email in Task if There is Data in the Variables Table


Katie

Question

I have a task that sets a variable of a list of agencies whose expiration date is equal to the current date. It then sends me an email with the variables table. It is working great, but it is possible to set it to only send me an email if there is data in the table? If none of the agencies expired today then I don't need an email at all.

See screenshot of task.

Thanks in advance for any help!

Task.png

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hi @Katie! Not sure if there are better ways to do this but it worked for me! What I did was I created a variable that basically counts the records returned using the same filters I have for my table variable. Then, I put the send email block in an if then block so it first checks if the variable count is 0 or not:
image.png.5810b0248099daf50ddd75c241adff11.png

Hope this helps!!

Link to comment
Share on other sites

  • 0

Hello @Katie,

It is possible to check if the Table Variable (the 'ProAgencies' Table Variable in this example) is not empty.

For that, please test any of these approaches:

1) To check if any field in the TOP 1 record of the Table Variable exists.

a9KUTgw.png

2) To check if any field in the TOP 1 record of the Table Variable is not blank.

osqmeWa.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...