Hi All,
I'm trying to add some offline capability to my QR Code scanner app, as it will be used in areas where mobile reception is flaky. The code seems to be fine syntactically, as Powerapps doesn't show a formula error, but neither the gallery control I added to view the collection, nor browsing to Collections in the File menu show anything (although the latter does have the column headings:
If(Connection.Connected, Patch(Attendees, {'Supplier Name':qrstring,Event:Dropdown1.SelectedText.Value, Guests:Slider1.Value});Reset(Slider1);
Navigate(Screen1, ScreenTransition.Cover),
Collect( offlineoutput, {'Supplier Name': qrstring, Event: Dropdown1.SelectedText.Value, Guests:Slider1.Value});
Navigate(Screen3, ScreenTransition.Fade))
What am I missing?
Did you try clearcollect instead of collect?
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/offline-apps
___
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Hi, yes I had it as ClearCollect originally - have just tried again and it behaves the same way, not writing anything to the collection.
Hi,
Your formula states that it will only collect if Connection.connected=false, which means there needs to be no internet connection available in any form when you test it (airplane mode on phone will work for this) - you can't test this from the editor as you're online when using the editor.
If(
Connection.Connected,
// True condition
Patch(Attendees,
{
'Supplier Name':qrstring,
Event:Dropdown1.SelectedText.Value,
Guests:Slider1.Value
}
);Reset(Slider1);
Navigate(Screen1, ScreenTransition.Cover),
// false condition
// will only trigger if there is no internet connection
Collect(offlineoutput,
{
'Supplier Name': qrstring,
Event: Dropdown1.SelectedText.Value,
Guests:Slider1.Value
}
);
Navigate(Screen3, ScreenTransition.Fade)
)
Could you try testing this on a mobile device that's on airplane mode (maybe have a screen where the collection is displayed in a gallery so that you can confirm?),
Cheers,
Sancho
@iAm_ManCat |
Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you! |
Thanks! |
Hey Sancho, that's exactly how I've been testing it actually - scanning a qr code while connected to make sure the connection.connected=true condition is working, and then putting my mobile into flight mode and scanning again to test the false condition.
The patch to sharepoint list works as expected, just not the collection. Apologies for not being clearer! 😊
Had a quick skim through Matt Schuesler's presentationon offline apps and I think collecting when offline is a no-go, seems more like you collect when online, and then use saveData, and when offline you use loadData
here's the full article if you want a nice primer on offline Apps:
https://jobs.collab365.community/powerapps-offline-disconnected-mode/
@iAm_ManCat |
Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you! |
Thanks! |
User | Count |
---|---|
251 | |
249 | |
82 | |
45 | |
27 |
User | Count |
---|---|
348 | |
262 | |
127 | |
60 | |
58 |