Office.context.mailbox.item.getSelectedRegExMatches() returns an empty array in the 'new Outlook' web experience while returning an expected array of one match in the old one.
While using a contextual add-in I click on the highlighted (matched) text like 'EXST-42' and expect Office.contex.tmailbox.item.getSelectedRegExMatches() to return {someMatches: ["EXST-42"]}.
Doing the same action in contextual add-in in new Outlook experience returns {someMatches: []}.
manifest.xml which looks like this:<ExtensionPoint xsi:type="DetectedEntity">
<Label resid="contextLabel" />
<SourceLocation resid="detectedEntityURL" />
<Rule xsi:type="RuleCollection" Mode="And">
<Rule xsi:type="ItemIs" ItemType="Message" />
<Rule
xsi:type="ItemHasRegularExpressionMatch"
RegExName="someMatches"
RegExValue="[0-9A-Z]+-\d+"
PropertyName="BodyAsPlaintext"
/>
</Rule>
</ExtensionPoint>
console.log() what Office.context.mailbox.item.getSelectedRegExMatches() returns.new Outlook web experienceThe meaning of existence is EXST-42.EXST-42 piece.
By triggering the exact string pattern we're trying to give users a context of what this string might be related to.
Hi I'm facing an error while trying to reproduce the scenario, can you please check your rule collection and let me know if some required attribute is missing?
@exextoc I've been following this guidelines while building my manifest file:
I can share the whole manifest if that would help anyhow but considering the fact I strictly followed the docs and have implemented the set of rules like in they show in examples out there I don't see a reason to throw it in here.
Could you please share the manifest file then? Will help while debugging. Thanks.
Here you go
<?xml version="1.0" encoding="UTF-8"?>
<OfficeApp
xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0"
xsi:type="MailApp">
​
<!-- IMPORTANT! Id must be unique for your add-in, if you reuse this manifest ensure that you change this id to a new GUID. -->
<Id>bd96ae50-29f0-475b-ae81-39796365e06d</Id>
​
<!--Version. Updates from the store only get triggered if there is a version change. -->
<Version>1.0.0.0</Version>
<ProviderName>Test contextual add-in</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<!-- The display name of your add-in. Used on the store and various places of the Office UI such as the add-ins dialog. -->
<DisplayName DefaultValue="Test contextual addin" />
<Description DefaultValue="Test description" />
​
<!-- Icon for your add-in. Used on installation screens and the add-ins dialog. -->
<IconUrl DefaultValue="https://previews.123rf.com/images/lkeskinen/lkeskinen1802/lkeskinen180208322/95731150-example-stamp-typographic-label-stamp-or-icon.jpg" />
<HighResolutionIconUrl DefaultValue="https://previews.123rf.com/images/lkeskinen/lkeskinen1802/lkeskinen180208322/95731150-example-stamp-typographic-label-stamp-or-icon.jpg" />
​
<SupportUrl DefaultValue="https://support.example.com" />
​
<Hosts>
<Host Name="Mailbox" />
</Hosts>
<Requirements>
<Sets>
<Set Name="Mailbox" MinVersion="1.1" />
</Sets>
</Requirements>
<FormSettings>
<Form xsi:type="ItemRead">
<DesktopSettings>
<SourceLocation DefaultValue="https://example.com/index.html" />
<RequestedHeight>450</RequestedHeight>
</DesktopSettings>
<PhoneSettings>
<SourceLocation DefaultValue="https://example.com/index.html" />
</PhoneSettings>
</Form>
</FormSettings>
​
<Permissions>ReadWriteItem</Permissions>
<Rule xsi:type="RuleCollection" Mode="Or">
<Rule xsi:type="ItemIs" ItemType="Message" FormType="Read" />
</Rule>
<DisableEntityHighlighting>false</DisableEntityHighlighting>
​
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
<!-- VersionOverrides for the v1.1 schema -->
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
<Requirements>
<bt:Sets DefaultMinVersion="1.3">
<bt:Set Name="Mailbox" />
</bt:Sets>
</Requirements>
<Hosts>
<Host xsi:type="MailHost">
<DesktopFormFactor>
<!-- Message Read -->
<ExtensionPoint xsi:type="DetectedEntity">
<Label resid="contextLabel" />
<SourceLocation resid="detectedEntityURL" />
<Rule xsi:type="RuleCollection" Mode="And">
<Rule xsi:type="ItemIs" ItemType="Message" />
<Rule
xsi:type="ItemHasRegularExpressionMatch"
RegExName="issueKeys"
RegExValue="[0-9A-Z]+-\d+"
PropertyName="BodyAsPlaintext"
/>
</Rule>
</ExtensionPoint>
</DesktopFormFactor>
</Host>
</Hosts>
​
<Resources>
<bt:Images>
<bt:Image id="icon32" DefaultValue="https://previews.123rf.com/images/lkeskinen/lkeskinen1802/lkeskinen180208322/95731150-example-stamp-typographic-label-stamp-or-icon.jpg" />
<bt:Image id="icon96" DefaultValue="https://previews.123rf.com/images/lkeskinen/lkeskinen1802/lkeskinen180208322/95731150-example-stamp-typographic-label-stamp-or-icon.jpg" />
<bt:Image id="icon144" DefaultValue="https://previews.123rf.com/images/lkeskinen/lkeskinen1802/lkeskinen180208322/95731150-example-stamp-typographic-label-stamp-or-icon.jpg" />
</bt:Images>
<bt:Urls>
<bt:Url id="detectedEntityURL" DefaultValue="https://example.com/contextual" />
</bt:Urls>
<bt:ShortStrings>
<bt:String id="groupLabel" DefaultValue="Test" />
<bt:String id="paneReadButtonLabel" DefaultValue="Test" />
<bt:String id="paneReadSuperTipTitle" DefaultValue="Show tickets" />
<bt:String id="contextLabel" DefaultValue="Test" />
</bt:ShortStrings>
<bt:LongStrings>
<bt:String id="paneReadSuperTipDescription" DefaultValue="Opens a pane displaying all available tickets." />
</bt:LongStrings>
</Resources>
</VersionOverrides>
</VersionOverrides>
</OfficeApp>
@exextoc I have a similar problem but this time getRegExMatches and getRegExMatchesByName don't work in _old_ Outlook experience. It returns null but it works in "new Outlook experience".
@mYokha Thanks for pointing out. For now you can use getRegExMatches
@modestfake I'm unable to reproduce the issue you are facing. Both the APIs are working fine in old outlook experience
Closing because issue is not reproducible.
@exextoc Is there any ETA for fixing Office.context.mailbox.item.getSelectedRegExMatches() in "new experience"?
@dmahugh could you please reopen the issue? As mentioned in this comment the original issue was confirmed.
@modestfake We have added the original issue to our backlog. Unfortunately, we have no timelines to share at this point. But We are not able to repro the issue in 'old owa experience' which you mentioned in this comment.
Thanks @exextoc. I'll try to reproduce it again and create a separate ticket with more details. For now the problem with getSelectedRegExMatches() is more important for us.
Re-opening issue per comment from @modestfake above.
I am also facing the same issue with Outlook 2013 desktop client wherein getRegExMatchesByName is returning null. Is there any workaround for now until this is fixed?
@kakusharma I'd like to focus this post on OWA. Outlook 2013 desktop client only has supports for older sections for the manifest and likely to be a different issue. Could you open a new post for what you are seeing with Outlook 2013 and share repro steps in the new post?
Sure, will do.
We have fixed the bug and the fix should be available in ~2-3 weeks. Closing this.
Most helpful comment
We have fixed the bug and the fix should be available in ~2-3 weeks. Closing this.