cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Marek
Helper I
Helper I

Patch SharePoint Online list Offline Online

Hi

 

I found something "strange" :

 

I have simple list NameraneHodnoty with Column IDMeraca

I put simple timer with for example 5second duration and repeating

OnTimerStart is function

 

If(Connection.Connected,
Refresh(NameraneHodnoty);Revert(NameraneHodnoty);
Patch(NameraneHodnoty,{IDMeraca:9123})
)

 

  • When App runs with internet, it works fine (putting new value into List)
  • When App runs with internet, lost connection, get connection back, it works fine (like above)
  • But - When app runs without internet, and then connection get back, on function Patch it is returningThe data source supplied to the function is invaliddataSourceSupplied.png

I tried it without Refresh / Revert but same resut.

(from I tested .. when powerapps run without internet, and then connect to internet, when it try to Patch value)

 

 

I tried to retrieve datasourceinfo but with no luck .. again same error message

If(Connection.Connected,

DataSourceInfo(NameraneHodnoty, DataSourceInfo.DisplayName, "IDMeraca");

Patch(NameraneHodnoty,{IDMeraca:9123})

)

 

 

Usage is when user add new items, it added just to collection and SaveData. When connection get back data are automatically send to server even if app is closed.

 

 

Maybe I am doing something wrong, just i found this issue.

Please, is there some workaround. Thanks

3 REPLIES 3
Meneghino
Community Champion
Community Champion

Hi @Marek

Your usage of Patch seems strange, in the case of writing to a data source you should have three parameters.

How is it working with just two?

Hi

 

yes sorry its wrong syntax

(hm it behave as as parameter is collection (puts new item into list))

 

my production code is

Clear(ClearCollect(NameraneHodnotyRefresh;Filter(NameraneHodnoty;ID=122)));;

Patch(NameraneHodnoty;NameraneHodnoty_NotSent);;

 

I tried to retrieve some existing data from data source via ClearCollect NameraneHodnoty before Patch but still error.

Meneghino
Community Champion
Community Champion

Hi @Marek, but I still don't understand the use of the Patch function with two parameters in your case and not the more usual three parameters.

Can you please supply the full OnTimeStart code?

Thanks.

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 (68,494)