OfficeDev / office-js-docs-pr

Microsoft Office Add-ins Documentation
https://learn.microsoft.com/office/dev/add-ins
Creative Commons Attribution 4.0 International
400 stars 248 forks source link

How to access a variable value from manifest.xml file in other js files #4230

Closed arshadansari10 closed 10 months ago

arshadansari10 commented 11 months ago

Hi,

I m developing a login api based project using excel addin api in js and I m using a globalUrl variable in a .js file which will change based upon the requirement. So during the build of the project is there any way through which I could declare my globalUrl value in manifest.xml file and accordingly access that value in other .js files like command.js or taskpane.js

millerds commented 11 months ago

You add-in can include any xml of json files you want as long as you deploy them with your code. However, the manifest.xml file has a specific schema it has to follow in order to be interpreted by the hosts and I don't believe that include options for custom properties. The manifest would fail validation if it had extra stuff in there.

AlexJerabek commented 10 months ago

Thanks for the response @millerds!

@Rick-Kirkham, are there documentation updates we should make with regards to this issue? If not, can we close this?

Rick-Kirkham commented 10 months ago

We can close this.