# Changing the help text based on a http request during oneditprepare

**URL:** <https://discourse.nodered.org/t/changing-the-help-text-based-on-a-http-request-during-oneditprepare/84947>\
**Category:** Developing Nodes\
**Created:** [26 January 2024 15:34 UTC](https://discourse.nodered.org/t/changing-the-help-text-based-on-a-http-request-during-oneditprepare/84947 "2024-01-26T15:34:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![SpieringsAE](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/spieringsae/32/87710_2.png) [@SpieringsAE](https://discourse.nodered.org/u/SpieringsAE)\
**Post date:** [26 January 2024 15:34 UTC](https://discourse.nodered.org/t/changing-the-help-text-based-on-a-http-request-during-oneditprepare/84947/1 "2024-01-26T15:34:57Z")

</div>

I have a node that needs to update the help text depending on what it gets back from a http GET request so in the html I have:

```auto
oneditprepare: function() {
	$.getJSON("myRequest", function(data) {
		if (data.includes("thing1")) {
			$(".Class1").show();
			$(".Class2").hide();
			$(".Class3").hide();
		} else if (data.includes("thing2")) {
			$(".Class1").hide();
			$(".Class2").show();
			$(".Class3").hide();
		} else if (data.includes("thing3")) {
			$(".Class1").hide();
			$(".Class2").hide();
			$(".Class3").show();
		} else {
			$(".Class1").hide();
			$(".Class2").hide();
			$(".Class3").hide();
			this.warn("couldn't identify which thing");
		}
	});
}

script type="text/x-red" data-help-name="myNode">
<div class="Class1">
	<p>help for thing1</p>
</div>
<div class="Class2">
	<p>help for thing2</p>
</div>
<div class="Class3">
	<p>help for thing3</p>
</div>
</script>

```

The other side of the request doesn't matter because that is working.

What is happening is that when I open my node it does what it is supposed to do, hides 2 out of 3 help texts. But then in less then a second it shows all three again.  
Something seems to be updating the html again to its original form and I can't figure out how to fix it.

Does anyone know what is happening? And hopefully also how I can fix it?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [26 January 2024 15:43 UTC](https://discourse.nodered.org/t/changing-the-help-text-based-on-a-http-request-during-oneditprepare/84947/2 "2024-01-26T15:43:17Z")

</div>

We do not support dynamically modifying the help text. The help content is refreshed whenever the current selection is changed and always reverts to the content provided in the `<script>` block.

And as the help can be browsed independently of the node, it doesn't necessarily make sense for it to be dynamically changed based on the 'current' node, because the current node could be anything in the workspace.

---

<div class="post-metadata">

**Author:** ![SpieringsAE](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/spieringsae/32/87710_2.png) [@SpieringsAE](https://discourse.nodered.org/u/SpieringsAE)\
**Post date:** [29 January 2024 07:34 UTC](https://discourse.nodered.org/t/changing-the-help-text-based-on-a-http-request-during-oneditprepare/84947/3 "2024-01-29T07:34:38Z")

</div>

Ah that's unfortunate, I guess I'll just type docs for the 3 different things with the appropriate headers. And then the user will have to determine which one applies to them themselves.

Thanks for your quick response!

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [29 January 2024 07:56 UTC](https://discourse.nodered.org/t/changing-the-help-text-based-on-a-http-request-during-oneditprepare/84947/4 "2024-01-29T07:56:39Z")

</div>

You can show or hide Tip text in the config panel dynamically.

---

<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:** [29 March 2024 07:57 UTC](https://discourse.nodered.org/t/changing-the-help-text-based-on-a-http-request-during-oneditprepare/84947/5 "2024-03-29T07:57:36Z")

</div>

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