Ending an Agent with an If statement

Is there an easy way to make an agent quit running if a certain condition is met? My agent works like this:

If ( a field on the document is not equal to another variable )

send an email

I need it to stop if that field is blank. I am using formula language.

I can provide more code if needed.

Thanks!

Subject: Ending an Agent with an If statement

@if (yourfield = “”;@Return(“”);“”)<>

Subject: RE: Ending an Agent with an If statement

That worked, thanks!