New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: How to pass configuration parameters to custom function's JavaScript context #130
Comments
Yes, AsyncStorage can be used to write the configuration info from the taskpane code and then be read from the custom functions code. You need to bundle the JavaScript for custom functions into a single file. The code here uses webpack for this. |
Ok, I see, that's what I feared. Thank you for the response. So my question becomes: will there ever be some kind of "push notifications" between the CustomFunctions and taskpane contexts like Sorry, another one: where are stored the |
Hi @alaincao, yes, we are working on a 'dispatch' model so you don't have to continuously poll. This will be a way to send messages and won't persist to disk. We'll share info during our Custom Functions call, but will not on our V1. Fill this out if you want to join our weekly call and I'll reach out: https://aka.ms/customfunctionscall. On Excel Online (and currently on Mac), AsyncStorage uses the browsers localstorage. I'll make a note for @davidchesnut / @mscharlock to add this to docs. thanks! |
Internal bug# 3281128 |
Just an update that we published info about the Storage object usage of browser localstorage on the Mac (around May 1). See https://docs.microsoft.com/office/dev/add-ins/excel/custom-functions-save-state. @keyur32 I'll remove myself from the assignee list on this issue. Thanks! |
@keyur32 Thanks for the updates on this issue! Just wondering what the current status is on the new "dispatch" model? We have some functionality ready to go with this feature 🙂 |
We are working on the documentation and release for insiders right now :) |
@davidchesnut Any update on this? Thanks. |
Hi @alaincao, following up on this thread, we have a preview feature that allows you to put the custom functions in the same context as the task pane, so they are both effectively using the same DOM. You can then share data or call functions as needed. For more information see Tutorial: Share data and events between Excel custom functions and the task pane (preview). This is the planned solution to your question going forward. Please let us know if you have any feedback on this approach. Thanks! |
Marking closed as it looks to not have had any response since last note. Please re-activate if further help is still needed. The feature David mentioned above, was using the Shared Runtime, and is also now generally available. Thanks! |
…ver-v4 Update webpack dev server v4
Hello there, this is more a question than an issue ; I hope this is the right place to ask ...
How can I pass general server configuration values to the custom functions context?
e.g. I have no problem within the taskpane context because I have access to a DOM where I can generate things like
but I have difficulties understanding how to do that for the CustomFunctions context since there is no HTML file nor DOM...
I mean, without access to
window.location.href
, I'm not even sure how to get the current server's URL (without hard-coding it which I am definitively not going to do) ; I could use that to make some request to/someoptionalvirtualpath/myparameters.json
.I thought about polling the AsyncStorage regularily and wait for the taskpane to post them there, but that really doesn't seem right ...
Subsidiary question: is there a way to use more than 1 JavaScript file for the CustomFunctions context? I haven't seen any way in the
manifest.xml
.e.g. { file_1: "http://server/parameters_generated.js", file_2: "http://server/myaddin.js" }
Thank you!
The text was updated successfully, but these errors were encountered: