# Object has no attribute 'getComponent' in actionPerform script

**URL:** <https://forum.inductiveautomation.com/t/object-has-no-attribute-getcomponent-in-actionperform-script/54381>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [December 22, 2021, 3:48am UTC](https://forum.inductiveautomation.com/t/object-has-no-attribute-getcomponent-in-actionperform-script/54381 "2021-12-22T03:48:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johnny\_Li1](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@Johnny\_Li1](https://forum.inductiveautomation.com/u/Johnny_Li1)\
**Post date:** [December 22, 2021, 3:48am UTC](https://forum.inductiveautomation.com/t/object-has-no-attribute-getcomponent-in-actionperform-script/54381/1 "2021-12-22T03:48:28Z")

</div>

Hi guys

I am current working on a button that has a script as shown below . I am just wondering is it possible to use getComponent from onActionPerformed event ?

many thanks  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/8/b832666ab6296ec2aada35bbffcf6920ba72ce8b.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/4/e4e39eb2faa58352ab6ccce3a0f878a5aac99d59.png)

---

<div class="post-metadata">

**Author:** ![lachguerabdallah](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lachguerabdallah/32/25558_2.png) [@lachguerabdallah](https://forum.inductiveautomation.com/u/lachguerabdallah)\
**Post date:** [December 22, 2021, 9:09am UTC](https://forum.inductiveautomation.com/t/object-has-no-attribute-getcomponent-in-actionperform-script/54381/2 "2021-12-22T09:09:24Z")

</div>

in perspective, there is no ‘getComponent ()’. use .getChildren ()

[https://docs.inductiveautomation.com/display/DOC80/Perspective+Component+Methods](https://docs.inductiveautomation.com/display/DOC80/Perspective+Component+Methods)

---

<div class="post-metadata">

**Author:** ![Johnny\_Li1](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@Johnny\_Li1](https://forum.inductiveautomation.com/u/Johnny_Li1)\
**Post date:** [December 22, 2021, 11:15pm UTC](https://forum.inductiveautomation.com/t/object-has-no-attribute-getcomponent-in-actionperform-script/54381/3 "2021-12-22T23:15:27Z")

</div>

thank you so much !  
it works
