I'm looking for a way to query calendar events a week in advance. So on Monday it will email all upcoming events for the next 7 days. I'd like it to be able to include date/time of the event along with event name. I have been able to get it to search all events past the current date including the title only. But I am unable to get it to include today until the end of the week only.
Any suggestions on how I can go about this?
Solved! Go to Solution.
I'm assuming you have a site workflow for this.
First step would be to schedule this workflow to run every Monday. You can set this up from Site Actions > Nintex Workflows > Schedule Site workflows, run it every 7 days and start it on a Monday.
Within your workflow, create a date-time variable, call it VStartDate, select the default as Today's date. Add action in workflow to perform date calculation. Add 5 days to this variable and call VEndDate.
Now you can query the event list where StartDate from even list is greater or equal to VStartDate AND EndDate is less than equal to VEndDate. That gives you the window within one week. Hope that helps.
Turns out that I had my end variable as multi line and had to change to to a collection. Is there a way I can query the title name and dates together so that when I dump it into an email the information is paired?
You can use the Index variable within For Each action. In the Query action, dump your Title and dates into collection variable. After that add a For Each action, use Index variable which starts at 0 from first item in your collection. Within the loop you can use Build String action to create text for the email.
If I'm understanding this right, you're suggesting that I put the title and dates into one collection variable? How do I do that? If I assign both to that within a query I get a configuration error.
I am also having difficulties finding the index variable.
Hi Garrett Martin ,
Sorry for not being clear. You will have to create 3 separate coll variables, 1 for title, 1 for Startdate and 1 for End Date.
The Index variable can be configured within the For Each loop action. This variable is selected to store the position of each item in the collection as it is accessed. The first item will be at position 0.
If you do not want to use Index, you can try first with just 1 collection and Build string with that. Then include others within the same For Each loop. Hope that helps.
So I'm at calc date, query list, for each - build string, for each - build string, to send notification referencing the end string variables of the build string actions.
When I get the email it shows up nicely with the date and event, but only shows the last event, not the two beforehand. I tried the collection actions as in that link as well with less of a result.