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
687 stars 94 forks source link

How can we get details of mailbox when multiple items are selected (shared mailboxes, delegated access)? #3989

Closed milczuk closed 9 months ago

milczuk commented 10 months ago

Is there any way to know if we are in the context of shared mailbox when having multiple items selected? On desktop outlook Office.context.mailbox.item is available we can use Office.context.mailbox.item.getSharedPropertiesAsync having shared properties I can build urls to get the details from ews using targetRestUrl from the response, and very important targetMailbox value on OWA and Desktop New Outlook Office.context.mailbox.item it's undefined. We can't tell if we are in context of shared mailbox or just standard mailbox, or if it's delegated scenario when we work in context of someone else's mailbox. Would it be possible to keep Office.context.mailbox.item have details of at one of the selected items to get the maibox details in those scenarios? Are there any plans for an API that would give us that information in multi select scenario?


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

milczuk commented 10 months ago

More on that I've found a comment that worries me a bit: https://github.com/OfficeDev/office-js/issues/3680#issuecomment-1732860872 When multiple emails are selected, it is expected that Office.context.mailbox.item will be null [...] if it's null then there is no way for us to know the shared properties, no target mailbox address to build queries...

thranejepsen94 commented 10 months ago

+1

AlexJerabek commented 10 months ago

Thanks for the questions. @samantharamon, could you please follow up?

samantharamon commented 10 months ago

@exextoc Could you please investigate this?

exextoc commented 10 months ago

When multiple emails are selected, it is expected that Office.context.mailbox.item will be null as there are multiple items selected. Getting getSharedPropertiesAsync when multiple items are selected is not supported at present. We track Outlook add-in feature requests on our Tech Community Page. Please submit your request there and choose the appropriate label(s). Feature requests on Tech Community are considered, when we go through our planning process.

mrebuffet commented 10 months ago

We are also impacted by this issue. I have up-voted this suggestion

I understand that this feature is currently unsupported but not having anything indicating that we are in the context of a shared mailbox makes it impossible to provide users with a message explaining that this feature is currently unsupported. Do you have any suggestion on how we could determine that we are in this scenario and inform our users?

All the returned properties seem to be common to the entire mailbox object so perhaps exposing them under the mailbox like so Office.context.mailbox.getSharedPropertiesAsync() would help.

Many thanks

CameronDwyer commented 10 months ago

+1

dangarkusha commented 4 months ago

To confirm and reiterate, the issue with multi-select in a shared mailbox persists and is reproducible in all OWA clients. When more than one email is selected, Office.context.mailbox.item becomes null preventing access to the only means of retrieval of a shared mailbox identity via Office.context.mailbox.item.getSharedPropertiesAsync().

image

We need a reliable way to retrieve the properties of the current mailbox.

+1 to the suggestion above to expose the method on the mailboxobject instead of the mailbox.item object like this:

PS: This is not a "feature" - it's a bug!