Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Microsoft Exchange Connector - Index Out of Range

I am using the Microsoft Exchange connector to report on time that is being booked in Microsoft Bookings.

 

I am simply connecting to the email address and navigating to the Calendar table:

joechristo_0-1694177088028.png

However when trying to view or expand any of the 'Record', 'List', or 'Table' fields, I recieve this error:

 

joechristo_1-1694177205474.png

Unexpected error: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Details:
Microsoft.Mashup.Evaluator.Interface.ErrorException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at Microsoft.Exchange.WebServices.Data.GetItemResponse.ReadElementsFromXml(EwsServiceXmlReader reader)
at Microsoft.Exchange.WebServices.Data.ServiceResponse.LoadFromXml(EwsServiceXmlReader reader, String xmlElementName)
at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.ParseResponse(EwsServiceXmlReader reader)
at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ReadResponse(EwsServiceXmlReader ewsXmlReader)
at Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.ReadResponseXml(Stream responseStream)
at Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.ReadResponse(IEwsHttpWebResponse response)
at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()
at Microsoft.Exchange.WebServices.Data.ExchangeService.BindToItem(ItemId itemId, PropertySet propertySet)
at Microsoft.Exchange.WebServices.Data.ExchangeService.BindToItem[TItem](ItemId itemId, PropertySet propertySet)
at Microsoft.Mashup.Engine1.Library.Exchange.ExchangeServiceCore.<>c__DisplayClass15_0.<GetItem>b__0()
at Microsoft.Mashup.Engine1.Library.Http.RetryPolicy.Execute[TResult](IEngineHost host, Func`1 func)
at Microsoft.Mashup.Engine1.Library.Exchange.ExchangeTracingService.GetItem(ItemId itemId, PropertySet itemPropertySet)
at Microsoft.Mashup.Engine1.Library.Exchange.EngineExchangeService.GetItem(String itemIdString, String folderPath, PropertyDefinitionBase[] properties, ExchangeColumnInfo[] columnInfos)
at Microsoft.Mashup.Engine1.Library.Exchange.ExchangeCachingService.GetItem(String itemIdString, String folderPath, PropertyDefinitionBase[] properties, ExchangeColumnInfo[] columnInfos)
at Microsoft.Mashup.Engine1.Library.Exchange.ExchangeCollectionTableValue.<GetEnumerator>d__8.MoveNext()
at Microsoft.Mashup.Engine1.Runtime.SkipTakeEnumerator`1.MoveNext()
at Microsoft.Mashup.Evaluator.SimpleDocumentEvaluator.ValuePreviewValueSource.TableValuePreviewValueSource.SerializeRows(Int32 count)
at Microsoft.Mashup.Evaluator.SimpleDocumentEvaluator.ValuePreviewValueSource.TableValuePreviewValueSource.get_SmallValue()
at Microsoft.Mashup.Evaluator.Interface.TracingPreviewValueSource.get_SmallValue()
at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.<>c__DisplayClass0_0.<RunStub>b__0()
at Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(String entryName, IEngineHost engineHost, IMessageChannel channel, Action action)
--- End of inner exception stack trace ---
at Microsoft.Mashup.Evaluator.EvaluationHost.<>c__DisplayClass17_0.<TryReportException>b__1()
at Microsoft.Mashup.Common.SafeExceptions.IgnoreSafeExceptions(IEngineHost host, IHostTrace trace, Action action)
at Microsoft.Mashup.Evaluator.EvaluationHost.TryReportException(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Exception exception)
at Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(String entryName, IEngineHost engineHost, IMessageChannel channel, Action action)
at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.<>c__DisplayClass12_0`1.<OnBeginGetResult>b__0()
at Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Action action)
at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetResult[T](IMessageChannel channel, BeginGetResultMessage message, Action`1 action)
at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetPreviewValueSource(IMessageChannel channel, BeginGetPreviewValueSourceMessage message)
at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.ChannelMessenger.OnMessageWithUnknownChannel(IMessageChannel baseChannel, MessageWithUnknownChannel messageWithUnknownChannel)
at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.EvaluationHost.Run()
at Microsoft.Mashup.Container.EvaluationContainerMain.Run(Object args)
at Microsoft.Mashup.Evaluator.SafeThread2.<>c__DisplayClass9_0.<CreateAction>b__0(Object o)
at Microsoft.Mashup.Container.EvaluationContainerMain.SafeRun(String[] args)
at Microsoft.Mashup.Container.EvaluationContainerMain.Main(String[] args)
--- End of inner exception stack trace ---
at Microsoft.Mashup.Evaluator.EvaluationHost.OnException(IEngineHost engineHost, IMessageChannel channel, ExceptionMessage message)
at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
at Microsoft.Mashup.Evaluator.Interface.IMessageChannelExtensions.WaitFor[T](IMessageChannel channel)
at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.PreviewValueSource.WaitFor(Func`1 condition, Boolean disposing)
at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.PreviewValueSource.get_Value()
at Microsoft.Mashup.Evaluator.Interface.TracingPreviewValueSource.get_Value()
at Microsoft.Mashup.Host.Document.Preview.PreviewEvaluation.<>c__DisplayClass22_0.<StartEvaluation>b__0(EvaluationResult2`1 result)

 

This is not happening for other tables, such as Meeting Requests:

 

joechristo_2-1694177347664.png

 

And ideas on what's causing it? I have tried creating my own Index and replacing the ID field with it:

 

joechristo_3-1694177440618.png

 

But get the same error:

 

joechristo_4-1694177478814.png

 

Thanks,

Joe

Status: Investigating
Comments
Anonymous
Not applicable

Hi @joechristo ,

 

There are a few possible ways to fix this error, depending on the cause and the context of your query. Here are some suggestions:

  • Check the length of your list or table before accessing an item by using the function. This will tell you how many items are in your list or table, and you can compare it with the index you are using. For example, if you have a list called , and you want to access the last item, you can use instead of .lenmyListmyList[len(myList)-1]myList[5]
  • Use the function to generate a sequence of numbers that are within the bounds of your list or table. This will help you avoid using an index that is too large or too small. For example, if you want to loop through all the items in your list, you can use instead of .rangefor i in range(len(myList)):for i in myList:
  • Handle the error gracefully by using a block. This will allow you to catch the error and perform some alternative action, such as skipping the item, logging the error, or displaying a message.

 

If I misunderstood your needs,please be free to let me know.

 

Best regards.
Community Support Team_Caitlyn

joechristo
Frequent Visitor

Hi @Anonymous,

 

Thanks for responding! I'm a little confused as to how to implement any of those steps in the following M Query:

 

joechristo_1-1694421064432.png

I am wanting to expand this table field:

 

joechristo_2-1694421124187.png

 

An index isn't referenced in the code at all. But trying to expand it gives me the error:

 

joechristo_3-1694421202939.png

 

I get the same error trying to expand any of the numerous 'Table', 'List' or 'Record' fields in the Calendar table