Wait For Data task & Data Monitors - how the heck do I use them?

Has anyone used the Wait For Data task and Data Monitors in DocStar before? I cannot figure out how to use them, and DocStar’s documentation on this is less than stellar (shocker).

I’m trying to add a branch to my AP workflow that sets aside any invoices whose POs do NOT have a Received Quantity on any line - that is, the things they purchased have not arrived & been received, but the invoice has. The user doesn’t want to waste time looking the invoice over if they can’t do anything with it.

I thought to set up a Data Monitor to look at my existing PO data datalink, and use the Wait For Data task to update when the Received Quantity value changes, so it’d kick the invoice back into the main. However nothing seems to happen. I have my Wait For Data task set to look at the “quantity” field, but nothing happens.

I could be wrong in how I’m going about the whole thing, but this seemed like the best method.

Any insight is appreciated

Edit: the “PO Data” is in the form of lines, so I’m using a field group. Not sure if that is important, but it’s relevant.

First thing to confirm is if you have the “Enable Workflow Polling” option enabled in the Admin > Site Settings section. This will allow you to set the timer on the Wait For task.

The Wait For task will wait for a variable to become true before allowing the workflow to proceed to the next Action. Every time the Wait For task evaluates if that variable is true, it will restart the Action the task is in when the variable is found to still be false. Assuming you have the AP Automation workflows in place, my advice would be to review the Read Receipts and Wait workflow step to see how this is setup by default to look for new receipts.

The Data Monitor is a newer feature and it simply allows you to batch a datalink task so as to avoid having the datalink run on multiple workflows at potentially inopportune times during the workday. The example I always use is that you could set the Read Payment Details datalink to run at 3:00AM each night, rather than have each document be checked on their own cadence throughout the day.

Hope that helps!

1 Like

Yep, I have polling enabled.

I’m not using “Wait For”, I’m using “Wait for Data” - I think it’s fairly new as well. Looks like it’s specifically for DataLinks, but maybe I should be using the old “Wait For” task instead?

I have the Data Monitor set up to look at the same DataLink that the workflow uses to populate PO lines in the first place. In the workflow history I can see that the Wait For Data task is indeed going off on the interval I set, it’s just no data is being populated.

Basically on my test invoice I have 3 PO lines, each with a null quantity. I want the Invoice to proceed when any of those Quantities is a real number. I update the quantity in the test data source I’m using, but the Data monitor doesn’t seem to see it.

Yes, the DataLink itself works.

Oh, I don’t think I was aware that there was a new task associated with the Data Monitor… I’ll have to look into that more to have a better understanding of how it works. I’m assuming that the screenshot you attached isn’t the actual Wait For Data task you’re using, correct? I only ask as it looks like the fields are blank.

It is, but only because I’m interested in one value only (Quantity). It’s up off the top of the screenshot.

This is the whole thing. All the values are inputs, rather than the outputs you see on a DataLink task. I figured I’d only need the one value I’m interested in since they’re inputs.

I’ve added the screenshot of the description for this task as I think the answer may lie in the “Input” section. If not the answer, then perhaps the next thing to look into. Based on my interpretation of what it states, it would seem to me that the “$Field.Quantity” you have populated in your Wait For Data task is going to be evaluated against the PO value quantities and only once they match will the workflow move on. Is this the intent of what you’re looking to do or you just want to move on when any value is populated into the quantity field?

1 Like

Oh I think I understand. I don’t think that’s quite what I’m needing to do. Here’s the procedure:

Invoice comes in with PO number.
WF pulls PO line item data from DB. There may be one, or many lines.
If Quantity = null, then go to wait task.
Wait for any of the quantity fields to become 1 (or any other number)
Update row with new quantity.
Return to main WF

Should I maybe instead just use a “sleep” task and push it back through the “line item pull” action again?

This is just my interpretation of this new task based on its description, but I’d need more time to confirm.

As for using the Sleep task, that is seems like a viable option. Another could be to first compare the quantity you have against the quantity found through the datalink and then set a variable to true, based on what you need. With that true/false variable you could use the original Wait For task.