Skip to main content

Hi ,

 

I am trying todays activities from the sharepoint calendar but somwhow it is not giving the accurate results .

 

Calendar contains on today

  1.  Event 1  : 11 am -12pm
  2. Event 2 -    1pm-2pm
  3. Event 3 3pm-4pm    

using the below condition .but it is only giving one entry based on the time I run the workflow .

suppose if i run the workflow in between 11am and 12 pm it is giving only event 1 details but I need all the event which are on today .

 

Hi @ragzt 

Let say that Today’s Date is 20-Jan and your events are stated as above.

Your Query should be for 

Start Time - Greater or equal - 20-Jan 12.00am
End Time - Less or equal - 20-Jan 11.55pm

You will need 2 variables to hold the Start and End time.
Use “Set Time Portion of Date/Time Field” action to create the variables for the Start and End time. 

 

 


Hi @ragzt 

Firstly the logic which you are using is incorrect.

 - StartTime <= TodaysDate  (condition 1)
 - EndTime >= TodaysDate   (condition 2)

When the workflow runs and you capture TodaysDate (you capture both the current Date and Time)

If wf run at 11.30am. Only Event 1 is returned.
 - Event 1 start time is 11am. so meets condition 1
 - Event 1 end time is 12pm, so meets condition 2
 - Event 2,3 end time is after 11,30am, meets condition 2 but does not meet condition 1
Return Results: Event 1

If wf runs at 12.30pm. No Event is returned.
 - Event 1 start time is 11am. so meets condition 1 but does not meet condition 2
 - Event 2,3 end time is after 11,30am, meets condition 2 but does not meet condition 1
Return Results: -blank-

 

 

You need to change the Query to the following
 Start Time - Greater or equal - 20-Jan 12.00am
 End Time - Less or equal - 20-Jan 11.55pm
Then, you should get all the event for that day.

 

NOTE: Event x 11pm-12pm
This event is NOT captured. To capture it, you need to define the end time as 
 End Time - Less or equal - 21-Jan 12.01am

You will need another step to create this end time. Add 1 day to current time, then set the time portion. OR you can add 1 day to the Start Time and save this as End time

 

 

 

 

 

 

 


Hi @Garrett  ,

Thanks for the response.

when we add 23 hrs minutes 59 to the end time then when the workflow runs afternoon 2 PM it will take tomorrows items too right?


Hi @ragzt 

Hi @Garrett  ,

Thanks for the response.

when we add 23 hrs minutes 59 to the end time then when the workflow runs afternoon 2 PM it will take tomorrows items too right?

Yes. it would. 

 

Just to clarity, you want to add 1 day (approx of 23hr and 59min) to End time.

This is the current variable 

%Start Time% Greater or equal - 20-Jan 12.00am
 %End Time% - Less or equal - 21-Jan 12.00am (via add 1 day to %Start Time%)

 

So, your new query is as follows

%Start Time% Greater or equal - 20-Jan 12.00am
 %End Time2% Less or equal - 22-Jan 12.00am (via add 1 day to %End Time%)
(alternatively add 2 day to %Start Time%)

This will take all the event items on the 20th and 21st

 

What is crucial for you to know is... when you want to schedule the workflow to run and what is the range of dates (Start and End) to fetch event items.

Example 1. Run WF every Friday 11am, fetch next week Mon-Fri events
Example 2. Run WF daily (Mon-Fri) 8am, fetch today’s events
 

 


Hi @ragzt 

Did you manage to get the correct event items from SharePoint? 

 


Reply