# Attribute Error in Component Custom Method

**URL:** <https://forum.inductiveautomation.com/t/attribute-error-in-component-custom-method/47712>\
**Category:** Ignition\
**Tags:** ignition81, scripting, vision\
**Created:** [June 11, 2021, 6:08pm UTC](https://forum.inductiveautomation.com/t/attribute-error-in-component-custom-method/47712 "2021-06-11T18:08:04Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 11, 2021, 7:20pm UTC](https://forum.inductiveautomation.com/t/attribute-error-in-component-custom-method/47712/15 "2021-06-11T19:20:31Z")

</div>

Fairly recently we made a sneaky change to the read and write functions to allow single elements to be passed, since it's a common 'papercut' issue for new users and our training department. The preferred syntax is still to call it with a list, but single values are accepted - that explains the syntax in the OP working.

> [@nminchin](#):
>
> From memory the only time you need to import system is when you define a function within a gateway scoped event with legacy scoping, or something… Im probably completely wrong… @paul-griffith?

Basically correct - gateway event scripts are the only system that still uses 'legacy' scripting, and therefore needs you to reimport `system` inside any defined functions.

---

_[View the full topic](https://forum.inductiveautomation.com/t/attribute-error-in-component-custom-method/47712)._
