# Accordion text name in perspective

**URL:** <https://forum.inductiveautomation.com/t/accordion-text-name-in-perspective/75888>\
**Category:** Ignition\
**Tags:** ignition81, perspective, scripting\
**Created:** [July 4, 2023, 10:34am UTC](https://forum.inductiveautomation.com/t/accordion-text-name-in-perspective/75888 "2023-07-04T10:34:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Priyanka.Khandge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/priyanka.khandge/32/35989_2.png) [@Priyanka.Khandge](https://forum.inductiveautomation.com/u/Priyanka.Khandge)\
**Post date:** [July 4, 2023, 10:34am UTC](https://forum.inductiveautomation.com/t/accordion-text-name-in-perspective/75888/1 "2023-07-04T10:34:22Z")

</div>

Hi guys,

Do you know when clicking on the header and then getting the accordion text name in the session custom property?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/3/632e37494e4ee57c1873f32ade9e23bbc2e02004.png)

Thanks,  
Priyanka

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [July 4, 2023, 11:46am UTC](https://forum.inductiveautomation.com/t/accordion-text-name-in-perspective/75888/2 "2023-07-04T11:46:40Z")

</div>

I'm sorry but... what's the question ?

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [July 4, 2023, 3:10pm UTC](https://forum.inductiveautomation.com/t/accordion-text-name-in-perspective/75888/3 "2023-07-04T15:10:10Z")

</div>

You can use the onItemExpanded/Collapsed Events to write to a custom property:

```auto
def runAction(self, event):
	self.custom.expandedAccordionText = self.props.items[event.index].header.content.text

```

---

<div class="post-metadata">

**Author:** ![Priyanka.Khandge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/priyanka.khandge/32/35989_2.png) [@Priyanka.Khandge](https://forum.inductiveautomation.com/u/Priyanka.Khandge)\
**Post date:** [July 4, 2023, 3:48pm UTC](https://forum.inductiveautomation.com/t/accordion-text-name-in-perspective/75888/4 "2023-07-04T15:48:56Z")

</div>

@cmallonee thank you for your response.

You are correct but in my case expand and collapse false so index id not found.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [July 4, 2023, 6:24pm UTC](https://forum.inductiveautomation.com/t/accordion-text-name-in-perspective/75888/5 "2023-07-04T18:24:26Z")

</div>

Then unless you're rendering the content as a View, there is no way to know about the text. As it looks like you _are_ rendering the content as a View, that _View_ should be responsible for declaring it was clicked and writing to the Session property.

---

<div class="post-metadata">

**Author:** ![Priyanka.Khandge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/priyanka.khandge/32/35989_2.png) [@Priyanka.Khandge](https://forum.inductiveautomation.com/u/Priyanka.Khandge)\
**Post date:** [July 5, 2023, 4:07am UTC](https://forum.inductiveautomation.com/t/accordion-text-name-in-perspective/75888/6 "2023-07-05T04:07:40Z")

</div>

@cmallonee Thanks for your response.

Yes. Resolved my problem using view.
