cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Automation Master
Automation Master

Re: Configuring a Workflow to send an alert when days have elapsed

I'm not sure what you mean.

do you want to send a notification just for first item found?

then you you can define a stop condition for 'for each loop' or do not use a loop at all.

or you mean one notification for an item?

if a workflow is scheduled just once per day, date condition should be met just on one specific date, so just one notification should be sent.

or any other requirement?

0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: Configuring a Workflow to send an alert when days have elapsed

I've never taken care of date part if I haven't needed time-precise comparison.

CAML by default makes comparison just on date level. you have to explicitly request it to make time-precise comparison.

however, I never supply date-type variable to query list action and/or CAML itself. I always supply ISO formatted date string. date-type variable never worked reliably for me in multi locale environment.

Reply
Highlighted
Nintex Newbie

Re: Configuring a Workflow to send an alert when days have elapsed

I've noticed that the Site Workflow on the date alert is only sending out an alert for the first item. where could I be going wrong?

0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: Configuring a Workflow to send an alert when days have elapsed

Hello,

You'll need to loop through the collection of items that you obtained from the Query List action - if you do not have the return variable set as a collection then you might only be getting back one response.   Double check that and see how many items you have.  Also make sure that more items meet your criteria for which you are checking other than the single row.

Thanks

Mike

Reply
Highlighted
Automation Master
Automation Master

Re: Configuring a Workflow to send an alert when days have elapsed

hm, now I'm confused.

above you've asked for a way how to send out just one/first notification. now you object that it works that way and sends only one notification.

what exactly are you trying to achieve?

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Configuring a Workflow to send an alert when days have elapsed

I'm now getting a Workflow Error. The error is on the For Each Action.

I'm using the CollectedHRDates Collection variable earlier in the Workflow to collect the initial return from the start date

form. Should I use a different Collection variable for the For each Action?



StartDate

This is how I've configured the For Each and subsequent Query actions.

How I understood it would work was that the For Each would target the Collection where the Start Dates are be stored, the saved to another variable called foreachcollectedstarttimes (which is a Date variable).

The Query action is configured to check that the Start Date is equal to CheckDate (which is the variable I've set up for the Calculate date action, then in the Output it's saving the Start Date in the CollectedHRDates.

So where have I gone wrong? Do I need more Collection variables and need to use them at different points?

Workflow error

0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: Configuring a Workflow to send an alert when days have elapsed

Hi Darren,

What's the workflow error that you are getting?

Thanks

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Configuring a Workflow to send an alert when days have elapsed

I don't know how helpful this will be Mike but it's showing an error at the For each stage

0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: Configuring a Workflow to send an alert when days have elapsed

Hi Darren,

Not the most verbose error now is it...     My suggestion to loop on the item ID collection and use an index set in the for each action in combination with a Collection Operation of "get" to pull the date and then do the compare.  You can log the date to make sure you are getting it back in the expected format to make your comparison.   

By having the item IDs in a separate collection (the one you loop through with the for each action) you will be able to use the id to update the item's status or do whatever you want to the item in the source list knowing which item you need to target.   You can also make sure you are getting back the set of expected values (log the ID collection out to see which items you are getting back) to make sure they match up with the ones you'd expect your Query Lists action to return (these are the ones that meet your criteria).  

Thanks,

Mike

Reply
Highlighted
Automation Master
Automation Master

Re: Configuring a Workflow to send an alert when days have elapsed

Darren,

I'm affraid, you over-complicated the things, or somehow missed the point how notification site workflow should work.

I would recommend to study and follow Cassy's blog once again.

what's the problem with your setup?

your first query list action retrieves item IDs(!)  that meet the condition StartDate == CheckDate. and stores them into (hopefully) collection variable 'CollectedHRDates'

then you set up a for each loop that iterates over this collection variable.

within the loop you perform logically just the same query list action, with only difference that it returns now StartDates instead of IDs. you store the result set to the same variable 'CollectedHRDates'.

first of all, the later query list action (one within the for each loop) overwrites 'CollectedHRDates' variable, which is driving variable of for each loop itself. not to surprise it causes error once next loop iteration is to be entered.

for the second, I do not see a reason for making the same query twice.

you could query for StartDates with first query action already. then within the loop pick the date from current collection element and use it as needed - eg. send it within the notification.

if you for any reasons need to do it in two steps - first to query for IDs and then by a given ID retrieve rest of the list fields (eg. StartDate) - then the second query action should have been filtered by an ID from first query (current collection element from for each loop iteration).

0 Kudos
Reply