cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Query Calendar events a week in advance

Jump to solution

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?

Labels: (1)
0 Kudos
Reply
12 Replies
Workflow Hero

Re: Query Calendar events a week in advance

Jump to solution

Hi Garrett,

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.

0 Kudos
Reply
Not applicable

Re: Query Calendar events a week in advance

Jump to solution

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?

0 Kudos
Reply
Workflow Hero

Re: Query Calendar events a week in advance

Jump to solution

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.

reference: how do you send a single email for multiple list items?

0 Kudos
Reply
Not applicable

Re: Query Calendar events a week in advance

Jump to solution

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.

0 Kudos
Reply
Workflow Hero

Re: Query Calendar events a week in advance

Jump to solution

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.

0 Kudos
Reply
Not applicable

Re: Query Calendar events a week in advance

Jump to solution

Tried this. Now I'm getting "3" in the emails instead of the actual event names and times.

0 Kudos
Reply
Not applicable

Re: Query Calendar events a week in advance

Jump to solution

Can you set an index variable that is not a number?

0 Kudos
Reply
Workflow Hero

Re: Query Calendar events a week in advance

Jump to solution

I hope this post by Vadim would clear your doubts: Nintex Workflow - Collection Variable - Vadim Tabakman

0 Kudos
Reply
Not applicable

Re: Query Calendar events a week in advance

Jump to solution

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.

0 Kudos
Reply