# Import rules by rest api

**URL:** <https://discourse.nodered.org/t/import-rules-by-rest-api/15855>\
**Category:** General\
**Created:** [24 September 2019 11:10 UTC](https://discourse.nodered.org/t/import-rules-by-rest-api/15855 "2019-09-24T11:10:51Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)\
**Post date:** [25 September 2019 14:57 UTC](https://discourse.nodered.org/t/import-rules-by-rest-api/15855/12 "2019-09-25T14:57:05Z")

</div>

> [@Change javascript code in function node](https://discourse.nodered.org/t/change-javascript-code-in-function-node/15891/1):
>
> Can we change Javascript code or rule written in function by external code or rule?  
> by rest-api or something else

What I believe the question was here is to have the full/partial part of the code inside the function node be changed, so not just incoming values, but the actual code. Sounds like something that can be done by running `eval()` calls inside the function node, but if you actually want to/should do that is a huge question, especially as those would be incoming from external requests/external code. If that external part gets compromised, you're giving your system away.

Can you explain what kind of rules or external code you are talking about, or in more detail what kind of functionality you want to have changed? There must be a far better way to do this than what you are asking to do.

---

_[View the full topic](https://discourse.nodered.org/t/import-rules-by-rest-api/15855)._
