0

would like to know how to get the recurring events for SharePoint calendar from SharePoint hosted app. There is an option to get normally using SPServices. But problem is we cannot use SPServices in SharePoint hosted app. I am stucking at below points:

  1. For weekly events which are recurring for every 2 or 3 weeks on specified weekdays like Sunday, monday etc.

  2. In above scenario how to calculate every 2 or 3 weeks dates based on starting event date.

I am using to get the recurrence data as following. It is giving me in xml string. based on that I am planning do calculations. I am able to successfully populate data for daily recurring events. But weekly it is problematic. monthly i haven't started yet.

appWebUrl +"/_api/SP.AppContextSite(@target)/Web/Lists/getByTitle('" + listTitle + "')/items(" + itemId + ")/RecurrenceData?@target='" + hostWebUrl + "'",

I am getting data as below

<recurrence><rule><firstDayOfWeek>su</firstDayOfWeek><repeat><weekly su="TRUE" mo="TRUE" tu="TRUE" we="TRUE" weekFrequency="1" /></repeat><repeatInstances>10</repeatInstances></rule></recurrence>

Now how to extract the dates based on above xml string?

1

Well there is no way to get the Recurring data using this endpoint because all it does is returns a XML schema. All you can do is use this schema and build your own logic to calculate date. you ca follow this blog for understanding different schema returned for different events.

This concerned is already being raise through user voice 1 and user voice 2

The only workaround we have right now is to use old vti_bin/list.asmx API also refer this blog for clear implementation of list.asmx API

|improve this answer|||||
  • You are right, still not supported currently.... – Jerry_MSFT Oct 13 '17 at 7:06
  • But is it possible to call list.asmx from SharePoint app? – Mihir Oct 13 '17 at 16:29
  • No, it's not possible. You have to write code into SharePoint – Akshay Randive Oct 13 '17 at 16:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.