# Can I access context from my html file?

**URL:** <https://discourse.nodered.org/t/can-i-access-context-from-my-html-file/44530>\
**Category:** General\
**Created:** [22 April 2021 09:09 UTC](https://discourse.nodered.org/t/can-i-access-context-from-my-html-file/44530 "2021-04-22T09:09:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dian](https://avatars.discourse-cdn.com/v4/letter/d/c4cdca/32.png) [@Dian](https://discourse.nodered.org/u/Dian)\
**Post date:** [22 April 2021 09:09 UTC](https://discourse.nodered.org/t/can-i-access-context-from-my-html-file/44530/1 "2021-04-22T09:09:01Z")

</div>

Hello, so here is some context (pun intended) : I'm using in my flow different read nodes, depending on the protocol used (s7, OPCUA, etc), connected to a plc, and I'm sending the payload {variableName1: data, variableName2: data etc...} to my custom formating node. The names of the variables are typed in these protocol nodes.

In my custom node, I have to type again the variable's name in an input, so I can target it when the payload arrives, apply the chosen formating function, and send the modified payload. I find it redundant, and would like to do otherwise.

 ![screen-node](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/9/5993736d285e80062b3418b2d4b6fc972eb3df39.png)

If I save the variables' name in the flow or global context, can I access them from my html file, so I can inject them dynamically in a dropdown select instead of having to type them again?

Node-RED v1.2.7  
Node.JS v14.15.4  
Nodes used in this exemple : node-red-contrib-s7 and IIOT

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [21 June 2021 09:09 UTC](https://discourse.nodered.org/t/can-i-access-context-from-my-html-file/44530/2 "2021-06-21T09:09:51Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
