Office-js: Settings.SaveAsync() not persistent when used in PowerPoint Online

Created on 3 Jul 2018  路  5Comments  路  Source: OfficeDev/office-js

We failed at store validation because the Settings API is not working as expected in PowerPoint Online.

  • Create a new presentation with PowerPoint Online
  • Add an Add In with use of Settings API to save a value

Example:

var mySetting = new Date().toString();
Office.context.document.settings.set("MySetting", mySetting);
Office.context.document.settings.saveAsync(function (asyncResult) {
    console.log('### Settings saved with status: ', asyncResult.status, asyncResult.error);
});
console.log("### Saved MySetting: " + mySetting);
  • asyncResult.status says "succeeded"
  • Save the document (done other changes in the slide to force auto-saving)
  • Close document
  • Trying to get the value when loading the document again:
Office.initialize = function (reason) {
    $(document).ready(function () {
        try {
            var mySetting = Office.context.document.settings.get("MySetting");
            console.log("### Loaded MySetting: " + mySetting);
...

Console-Output:
### Loaded MySetting: null

The setting has NOT been saved with the document!

_The Setting API seems to have a bug in this context (PowerPoint Online?)_

product bug

All 5 comments

Please validate this issue and tell me if it is a bug. We have to know this for our store validation!
(You could have our manifest to try it out)

quick question is this a content add-in or a task pane Add-in. I am able to repro on content add-ins.

Yes! It is a content add in. Thanks for reproducing!
Could you please tell me the internal VSO bug nr for the tester. TIA.

this issue is now fixed !

We see great Improvements in PowerPoint Online - seems that actual many things concerning presentation mode and display of content add ins is revised. 馃憤
We tested this issue and can confirm that it is fixed.

Was this page helpful?
0 / 5 - 0 ratings