Query List and Run If Problems


Badge +6

Good morning,

I'm hoping someone can help me understand how to set up a query list and run if workflow. I've read similar posts but there not dumbed down enough for me to understand where mine keeps failing.

I have a list on a site called Report Schedule List. The list has a Report Name, Due Date and Report Owner columns. I have set up a site workflow to run once a day forever. What I'm trying to get the work flow to do is each day query the list looking for any date that equals today (I've created variables for the report due date and report owner) and for each item that is due on the day the workflow is run send the report owner an task.

I've created variables to capture the due date and report owner and collections for the same. I really have no idea what I'm doing.

I've attached my workflow in hopes greater minds can help me out.

Thanks

Andrew


6 replies

Userlevel 5
Badge +14

could you rather provide screenshot of your workflow and query list action configuration?

plus, provide an example how you format the due date in the query

Badge +6

Hi Marian,

I have inserted a number of images. The workflow, the query list set up, For Each set up and the Run If set up. The list of reports I'm pulling from as a number of reports that are due on the same day so I figured I need to collect the due dates.

Thanks

WorkflowQuery list due dateFor each set upRun If set up

Userlevel 5
Badge +14

could you post how have you configured filter in query list action?

regarless of that, I affraid there are few design flaws

- are you aware of that if you assign tasks in a loop, the loop will proceed to next iteration (so assigning next task) just after previous task is responded?

- you check for due date in runif action, I would say this condition/filter should be possible to move to query list. you will get much smaller dataset to process (only items that you realy need to take care about)

- I'm not exactly sure about datatypes of your variables, but from their names it looks like total misusage ...

query list - variables to store returned data should be collections. if they are not you will capture just first value out dataset returned by the query. if they are collections, then varDueDate should have been a target collection in follow-up for each loop action.

for each - as already mentioned, target collection should have been a (collection) variable populated by query list action. you configured here some new collection. not sure whether it is populated or but it seem to be unrelated to query list action

run if - you seem to compare scalar variable to a collection one. this can not work

I would highly recommend to search the forum for topics that deal with sending reminders from site workflow. they are very similar to your case

https://community.nintex.com/search.jspa?q=reminders+site+workflow 

following Cassy Freeman‌' blogpost on Nintex Xchange™ is provided with downloadable example you can play/start with Document Review and Approval (State Machine) Workflow 

Badge +9

Hi Andrew Robinson‌,

Try the following steps.

1. Create workflow variable called "dtTodaysDate".

203791_pastedImage_1.png

2. Query List action.

203796_pastedImage_1.png

3. For each loop.

203794_pastedImage_4.png

4. Query list (to get due date and report owner)

203797_pastedImage_1.png

5. Assign to do task.

Thanks,

Lakshmi Narayana C

Badge +6

‌ Thanks so much for your help. This worked. Is it possible to query a list to look for due dates approaching in five days and send the task when the due date is five days away? I looked at the date calculation option but I'm lost.

I suppose I could just create another list column for the task assignment date but if you know of a more intelligent way of doing this it would be appreciated.

Thanks again.

Andrew

Badge +9

Hi Andrew Robinson‌,

Good you got the result.

And regarding to get the date of five days before from due date, you can't set a condition in the query list action itself.

First query the list and apply some filter condition to get your result set and after that if calculate date action is available in your Nintex version you can use it to get the required date.

Thanks,

Lakshmi Narayana C

Reply