inconsistent sessionData.getAllAsync return value #5353
Labels
Area: Outlook
Issue related to Outlook add-ins
Status: in backlog
Issue is being tracked in the backlog but timeline for resolution is unknown
Type: product bug
Bug in the Office Add-ins platform or Office JavaScript APIs
Hello,
Is sessionData.getAllAsync supposed to return a dictionary?
At least documentation is not clear https://learn.microsoft.com/en-us/javascript/api/outlook/office.sessiondata?view=outlook-js-preview#outlook-office-sessiondata-getallasync-member(1)
it states: "Gets all session data key-value pairs."
It seems that when sessionData is empty it returns string '{}' (not an dictionary object).
Here is a code snippet to reproduce the issue:
`
Office.context.mailbox.item.sessionData.getAllAsync((asyncRes1)=>{
let allData1 = asyncRes1.value;
let type1 = typeof allData1; // 'string' <-- we got a string '{}' not an empty dictionary object
});
`
I'm running this in Outlook taskpane in Compose window.
Or should I do some initialization so that sessionData is always initialized to object.
Please advise.
Kind Regards,
Bojan
The text was updated successfully, but these errors were encountered: