cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tejasvi_munge
Post Partisan
Post Partisan

"the request was not sent or there was no response from the server" issue in offline mode

Hi Experts,

I am trying to create an app for offline. When I open an app without internet connection I get error on top of app saying "The request was not sent or there was no response from the server. Check your internet connection. Server response:"Entity name" failed: Something went wrong"

I believe there should not be any message error messages even if your in offline mode.

How can I get rid of it?

Thanks in advance. 

 

11 REPLIES 11
WarrenBelz
Super User III
Super User III

Hi @Tejasvi_munge ,

The PowerApps function Connection.Connected needs to be used on every control/form that references the online data.

So for instance if a form and the data source was the List Widgets, the for DataSource would be

If(
   Connection.Connected,
   Widgets
)

so if offline, Connection.Connected would be false and the form would not look for the list.

Happy to elaborate further on specific code that is causing error.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

 

Hi @WarrenBelz ,

I am not sure what causing this error. But I feel below code might cause the error.
I have one screen on which i have lookup filed which I want to autopopulate so I used formula-
LookUp(BusCollection,'Contact Lookup'.Contact=LookUp(ContactCollection,Email=User().Email,contactid),cre08_busid)
So here based on logged in used I am fetching the unique identifer column value of one entity. Detail of this you will get here. I able to get the required value. But it is working for online only. Offline it is not working and throws that mentioned error and gives "False" in my textinput .

Is it because of names I am using? When to use display name and name in offline powerapps for CDS data source. or How can I do that for offline.?

Thanks in advance.

Hi @Tejasvi_munge ,

In that code you have two Collections - BusCollection and ContactCollection

LookUp(
   BusCollection,
   'Contact Lookup'.Contact=
   LookUp(
      ContactCollection,
	  Email=User().Email,contactid
   ),
   cre08_busid
)

How are you collecting these if you are offline?

 

hi @WarrenBelz ,

I have this on On start of app-

If(
Connection.Connected,        //Contact
ClearCollect(
ContactCollection,
Contacts
);
SaveData(
ContactCollection,
"SaveitemstokeepContact"
),
LoadData(
ContactCollection,
"SaveitemstokeepContact",
true
);

);

If(
Connection.Connected,       //Bus
ClearCollect(
BusCollection,
Buses
);
SaveData(
BusCollection,
"Saveitemstokeepbus"
),
LoadData(
BusCollection,
"Saveitemstokeepbus",
true
);
);
Below code on ON visible of landing screen-
ClearCollect(
JourneyColletion,
Journeys
);
ClearCollect(
JourneyDetailsCollection,
'Journey Details'
);
ClearCollect(
BusCollection,
Buses
);

And then on onscreen I have TextInput7 having(I want to auto populate this field and send it to CDS while offline as well) -

LookUp(
   BusCollection,
   'Contact Lookup'.Contact=
   LookUp(
      ContactCollection,
	  Email=User().Email,contactid
   ),
   cre08_busid
)

And on submit button on that screen I have-

If(Connection.Connected,
Patch(Journeys,Defaults(Journeys),{
cre08_name:TextInput2.Text,'Route ID Lookup': LookUp(Routes,Route=GUID(TextInput8.Text)),'Bus ID Lookup':LookUp(Buses,Bus=GUID(TextInput7.Text))
}),
Collect(JourneyColletion,{cre08_name:TextInput2.Text,cre08_routeid: LookUp(RouteCollection,Route=GUID(TextInput8.Text)),cre08_busid:LookUp(BusCollection,Bus=GUID(TextInput7.Text))
});
SaveData(JourneyColletion,"Saveitemstokeep")
);
Reset(TextInput2);Reset(TextInput7);Reset(TextInput8);

 

 

That's it.

Am I missing anything?
Thanks in advance

Hi @WarrenBelz ,

 

I was reviewing the last input from @Tejasvi_munge , I am not sure if I missed something, if you have the chance could you please double check as well.

Hi @danielbazetto ,

I must have missed the post. The first bit App OnStart will do the job

f(
   Connection.Connected,        //Contact
   ClearCollect(
      ContactCollection,
      Contacts
   );
   SaveData(
      ContactCollection,
      "SaveitemstokeepContact"
   ),
   LoadData(
      ContactCollection,
      "SaveitemstokeepContact",
      true
   );
);

If(
   Connection.Connected,       //Bus
   ClearCollect(
      BusCollection,
      Buses
   );
   SaveData(
      BusCollection,
      "Saveitemstokeepbus"
   ),
   LoadData(
      BusCollection,
      "Saveitemstokeepbus",
   true
   )
)

The Screen OnVisible however will not work offline - it references the data source

ClearCollect(
   JourneyColletion,
   Journeys
);
ClearCollect(
   JourneyDetailsCollection,
   'Journey Details'
);
   ClearCollect(
   BusCollection,
   Buses
)

This will not work offline as it references one of the collections above

LookUp(
   BusCollection,
   'Contact Lookup'.Contact=
   LookUp(
      ContactCollection,
      Email=User().Email,contactid
   ),
   cre08_busid
)

The Submit button looks fine except there is no mention of where RouteCollection comes from (and as long as all the information is present).

If(
   Connection.Connected,
   Patch(
      Journeys,
	  Defaults(Journeys),
	  {  
         cre08_name:TextInput2.Text,
		 'Route ID Lookup': 
         LookUp(
            Routes,
            Route=GUID(TextInput8.Text)
         ),
         'Bus ID Lookup':
         LookUp(
            Buses,
            Bus=GUID(TextInput7.Text)
         )
      }
   ),
   Collect(
      JourneyColletion,
      {
         cre08_name:TextInput2.Text,
         cre08_routeid: 
         LookUp(
            RouteCollection,
            Route=GUID(TextInput8.Text)
         ),
         cre08_busid:
         LookUp(
            BusCollection,
            Bus=GUID(TextInput7.Text)
         )
      }
   );
   SaveData(
      JourneyColletion,
      "Saveitemstokeep"
   )
);
Reset(TextInput2);
Reset(TextInput7);

HI,

 

We have also start facing same issue in offline mode.

As per suggestion, we have applied same logic in code where we using the data source for locally storing data for later offline access, but we still facing same error and form loading very slowly on screen.

 

kindly suggest any other way concern issue. 

@sandhyayadav16 ,

It may be better to post your query on a new thread as it is a different issue.

This seems to still be an ongoing issue. Did you ever find a fix?

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (71,918)