Error when trying to retrieve data from the network

Today I got the error: Error when trying to retrieve data from the network

Error when trying to retrieve data from the network

What is causing the Error when trying to retrieve data from the network error?

The first step is to identify which line of code is generating the error.

Quite quickly I identified that the following code caused the problem.

ClearCollect(
colAllDocuments,
'Documents'
);

The above line of code is reading document details form a document library and in my case I have three version of the datasource. One for Development, one for test and one for production. Only development was showing this issue.

Then as I looked through the library settings, I found that I had 5 People fields and 7 Lookups. These are all considered lookup fields and there is a maximum of 12 lookup fields that Power apps is happy to read.

Then I used PnP PowerShell and exported the list to XML and I noticed that in development I had a field

 <Field ID="{5cf76f15-5ced-4ddc-b409-7134ff3c332f}" Type="TaxonomyFieldTypeMulti" DisplayName="Image Tags" Name="MediaServiceImageTags" Group="_Hidden" Hidden="FALSE" Sealed="FALSE" ReadOnly="FALSE" ShowInNewForm="TRUE" ShowInDisplayForm="TRUE" ShowInEditForm="TRUE" ShowInListSettings="FALSE" Viewable="FALSE" Json="FALSE" SourceID="{{listid:Documents}}" StaticName="MediaServiceImageTags" ColName="int10" RowOrdinal="0" List="{listid:TaxonomyHiddenList}" WebId="{siteid}" ShowField="Term1033" Version="2" Mult="TRUE" Sortable="FALSE">
              <Customization>
                <ArrayOfProperty>
                  <Property>
                    <Name>SspId</Name>
                    <Value xmlns:q1="http://www.w3.org/2001/XMLSchema" p4:type="q1:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">{sitecollectiontermstoreid}</Value>
                  </Property>
                  <Property>
                    <Name>GroupId</Name>
                  </Property>
                  <Property>
                    <Name>TermSetId</Name>
                    <Value xmlns:q2="http://www.w3.org/2001/XMLSchema" p4:type="q2:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">{termsetid:System:Image Tags}</Value>
                  </Property>
                  <Property>
                    <Name>AnchorId</Name>
                    <Value xmlns:q3="http://www.w3.org/2001/XMLSchema" p4:type="q3:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">fba54fb3-c3e1-fe81-a776-ca4b69148c4d</Value>
                  </Property>
                  <Property>
                    <Name>UserCreated</Name>
                    <Value xmlns:q4="http://www.w3.org/2001/XMLSchema" p4:type="q4:boolean" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">false</Value>
                  </Property>
                  <Property>
                    <Name>Open</Name>
                    <Value xmlns:q5="http://www.w3.org/2001/XMLSchema" p4:type="q5:boolean" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">true</Value>
                  </Property>
                  <Property>
                    <Name>TextField</Name>
                    <Value xmlns:q6="http://www.w3.org/2001/XMLSchema" p4:type="q6:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">{7c51d632-27e0-f6f7-a5d6-ed67b68bd369}</Value>
                  </Property>
                  <Property>
                    <Name>IsPathRendered</Name>
                    <Value xmlns:q7="http://www.w3.org/2001/XMLSchema" p4:type="q7:boolean" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">false</Value>
                  </Property>
                  <Property>
                    <Name>IsKeyword</Name>
                    <Value xmlns:q8="http://www.w3.org/2001/XMLSchema" p4:type="q8:boolean" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">false</Value>
                  </Property>
                  <Property>
                    <Name>TargetTemplate</Name>
                  </Property>
                  <Property>
                    <Name>CreateValuesInEditForm</Name>
                    <Value xmlns:q9="http://www.w3.org/2001/XMLSchema" p4:type="q9:boolean" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">true</Value>
                  </Property>
                  <Property>
                    <Name>IsDocTagsEnabled</Name>
                  </Property>
                  <Property>
                    <Name>FilterAssemblyStrongName</Name>
                    <Value xmlns:q10="http://www.w3.org/2001/XMLSchema" p4:type="q10:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">Microsoft.SharePoint.Taxonomy, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Value>
                  </Property>
                  <Property>
                    <Name>FilterClassName</Name>
                    <Value xmlns:q11="http://www.w3.org/2001/XMLSchema" p4:type="q11:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">Microsoft.SharePoint.Taxonomy.TaxonomyField</Value>
                  </Property>
                  <Property>
                    <Name>FilterMethodName</Name>
                    <Value xmlns:q12="http://www.w3.org/2001/XMLSchema" p4:type="q12:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">GetFilteringHtml</Value>
                  </Property>
                  <Property>
                    <Name>FilterJavascriptProperty</Name>
                    <Value xmlns:q13="http://www.w3.org/2001/XMLSchema" p4:type="q13:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">FilteringJavascript</Value>
                  </Property>
                </ArrayOfProperty>
              </Customization>
            </Field>

This is a managed metadata field that doesn’t appear in the test and production sites. Ok, it looks like this was added ( for no good reason!) to my list.

Fixing the issue

Once I cleared this up my problem went away and SharePoint was working as my data sources again and the “Error when trying to retrieve data from the network” error disappeared.

In my case I was lucky, there was a field that wasn’t needed. But in general I would try and avoid lookups where possible when using SharePoint as a data source. Having a number column that contains the number of the related list is often easier.

And isn’t the idea of developing an app that you keep users away from your SharePoint lists anyway?

Continue Reading Pieter Veenstra’s Article on their blog

Error when trying to retrieve data from the network

Today I got the error: Error when trying to retrieve data from the network The first step is to identify which line of code is generating the error. Quite quickly I identified that the following code caused the problem.

Blog Syndicated with Pieter Veenstra’s Permission

Author: Pieter Veenstra

Share This Post On
Share via
Copy link
Powered by Social Snap