OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
686 stars 95 forks source link

Settings Object could not be loaded when it is saved with difference manifests - from Store vs manually upload #840

Closed cpornputthasri closed 4 years ago

cpornputthasri commented 5 years ago

We are using Office.context.documents.settings.set() / .get() to manage settings on a file but when the same file is opened on different manifests, one via Add-in on store and one via manually upload. Each Add-in could not load settings data which was saved from each add-in version.

We also try with Excel.SettingCollection.add() / . getItemOrNullObject() and it gave the same result.

Expected Behavior

When add-in saves settings data to a file and it should be readable from the same add-in even if it is opened from different environments or even with different manifest version.

Current Behavior

Settings data which is saved from an add-in which is available on store, could not be read from the same add-in which is manually uploaded.

lliu113 commented 5 years ago

Thanks for logging this! Looping in Mandy to help investigate

JuaneloJuanelo commented 5 years ago

this is by design. Settings are stored per instance per document. The ID of your add-in is not the same when you sideload that when it comes from the store.

cpornputthasri commented 5 years ago

@JuaneloJuanelo Thank you for your response.

In this case, the manifest from the store is updated, the same file with stored data from the previous version should be readable in the new version, right?

We still do not have any new version of manifest on the store yet. So that, I would like to confirm for this behavior?

RuoyingLiang commented 4 years ago

As long as the ID is not changed, the setting should be readable from the new add-in. Please let us know if you encounter issue after update.

ghost commented 4 years ago

This issue has been automatically marked as stale because it is marked as needing author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your interest in Office Add-ins!

ghost commented 4 years ago

This issue has been closed due to inactivity. Please comment if you still need assistance and we'll re-open the issue.