Please be so kind as to read my full post before responding.
Thank you for your consideration.
I recently came across the issue, that one of my PowerApps which I remember to have been usable offline, did not work offline anymore.
I might be wrong with my memory.
Some testing revealed to me that the semantics of the "Choices" function (for a Dynamics/CDS (MultiSelect) OptionSet field) inside the "Items" property of the ComboBoxes inside my PowerApps seem to have changed.
It appears as if Choices used to be evaluated at the time of saving/publishing (thus making ComboBoxes with Choices as Items usable offline), but is now evaluated at the time of the function call (requiring Connection.Connected when the ComboBox is set up at runtime).
As a workaround to restore offline capabilites I now have to use something like:
App.OnStart
If(Connection.Connected, ClearCollect(MultiSelectOptions, Choices(Source.Column)); SaveData(MultiSelectOptions, "MultiSelectOptions"), LoadData(MultiSelectOptions, "MultiSelectOptions") )
ComboBox.Items
MultiSelectOptions
My questions:
HI @SaWu ,
Could you please share a bit more about your issue?
Do you create an Offline app on your side?
Actually, the OptionSet Combo box values (Items property) in your Edit form would be populated only when you new or edit the Edit form rather than when you load your app.
If your app is in Offline status before you create a new form or edit a form, the OptionSet ComboBox would not be populated with values from your data source (Dynamics 365 or CDS Entity) when you navigate to the edit screen.
I agree with the workaround that you mentioned. Actually, the workaround you mentioned is the key point/essence in creating an Offline app.
More details about creating an offline app in PowerApps, please check the following blog:
https://powerapps.microsoft.com/en-us/blog/build-offline-apps-with-new-powerapps-capabilities/
Best regards,
Thanks for creating this thread @SaWu - can you review the above reply and update the thread if it was helpful?
@Anonymous
I have seen the reply.
It has not been helpful.
The reply has not answered any of my questions.
Yes, I had an PowerApp, following the blog article mentioned, that worked and was tested offline before.
It does not work anymore.
Trying to recreate is also does not work for my custom entities.
As I have explained in my original post, the issue seems to be with option sets, and a change of Choices for static OptionSets.
Option sets are nowhere mentioned in the blog post.
Thus, I don't see how the key point of my problem can be contained in said blog post.
I also don't see how said reply could have been helpful.
Is it possible to get (or pay) an actual developer, who can technically understand my question, to write some answers?
It also okay for me to have someone, who really knows, to tell me that I must be miss-remembering that my PowerApp was working offline before because there never was such a capability using Choices for OptionSets.
Thank you for you consideration.
@SaWu , Did you ever got the chance to resolve this?
I am experiencing the same thing with optionsets and two options during offline mode.
Hi @fkatada
I never got a real resolution for this.
For my offline Apps I now use the workarounds of
Of course this only works if the PowerApp is initially loaded while online.
Later uses are able to be offline as well.
For example App.OnStart could be something like
// SaveData does not work in browser so in a browser this will cause an ignored warning/error
Set(isBrowser, !(CountRows(SaveData(["1", "2"],"myTestList").Value)=2));
If(
// Connection.Connected
Connection.Connected, Concurrent(
ClearCollect(LocalOptionSet1, Choices(AnEntity.AnOptionSetField));
If(!isBrowser, SaveData(LocalOptionSet1, "LocalOptionSet1")),
ClearCollect(LocalOptionSet2, Choices('AnotherOptionSetField (AnotherEntity)'));
If(!isBrowser, SaveData(LocalOptionSet2, "LocalOptionSet2")),
ClearCollect(LocalOptionSet3, Choices('GlobalOptionSet'));
If(!isBrowser, SaveData(LocalOptionSet3, "LocalOptionSet3")),
Concurrent(
Set(optionSet1Value, 'AnOptionSetField (AnEntity)'.aValue),
Set(optionSet2Value, 'AnotherOptionSetField (AnotherEntity)'.anotherValue),
Set(optionSet3Value, 'GlobalOptionSet'.yetAnotherValue)
);
ClearCollect(LocalOptionSetValues, {
optionSet1Value: optionSet1Value,
optionSet2Value: optionSet2Value,
optionSet3Value: optionSet3Value
});
If(!isBrowser, SaveData(LocalOptionSetValues, "LocalOptionSetValues"))
),
// !Connection.Connected && !isBrowser
!isBrowser, Concurrent(
LoadData(LocalOptionSet1, "LocalOptionSet1"),
LoadData(LocalOptionSet2, "LocalOptionSet2"),
LoadData(LocalOptionSet3, "LocalOptionSet3"),
LoadData(LocalOptionSetValues, "LocalOptionSetValues");
Concurrent(
Set(optionSet1Value, First(LocalOptionSetValues).optionSet1Value),
Set(optionSet2Value, First(LocalOptionSetValues).optionSet2Value),
Set(optionSet3Value, First(LocalOptionSetValues).optionSet3Value)
)
)
)
In the rest of the App you'd then use the local collections LocalOptionSet1, LocalOptionSet2, LocalOptionSet3, and global variables optionSet1Value, optionSet2Value, optionSet3Value, and so forth.
Best of luck with this,
Sa.
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
202 | |
174 | |
62 | |
32 | |
31 |
User | Count |
---|---|
329 | |
268 | |
104 | |
72 | |
56 |