# Reading data from GUI AlarmStatusTable to check Cell Style

**URL:** <https://forum.inductiveautomation.com/t/reading-data-from-gui-alarmstatustable-to-check-cell-style/102930>\
**Category:** General Discussion\
**Tags:** designer, scripting, python\
**Created:** [February 26, 2025, 8:01pm UTC](https://forum.inductiveautomation.com/t/reading-data-from-gui-alarmstatustable-to-check-cell-style/102930 "2025-02-26T20:01:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![iwan.tolboom](https://avatars.discourse-cdn.com/v4/letter/i/439d5e/32.png) [@iwan.tolboom](https://forum.inductiveautomation.com/u/iwan.tolboom)\
**Post date:** [February 26, 2025, 8:01pm UTC](https://forum.inductiveautomation.com/t/reading-data-from-gui-alarmstatustable-to-check-cell-style/102930/1 "2025-02-26T20:01:12Z")

</div>

Based on the code in this topic [Customizing Alarm Status Table](https://forum.inductiveautomation.com/t/customizing-alarm-status-table/61102/8) we want to read the rows displayed in the AlarmStatusTable to check if the styling (color and font) of each row is correct(values of cells would be a plus).  
First the inner Table is acquired with `innerTable = self.findComponentOfClass( theComponent, 'AlarmStatusTable$1' )` then with `model=innerTable.model` access to the data should be possible. With `model.getValueAt(row, column)` a cell could be read and printed.  
But when there are 8 active alarms visible in the table, at most 1 line is returned with `model.getRowCount()` and there is not a logical reason for displaying that particular alarm. So it is not the 1st, 2nd, or the n-th that will trigger the availability of that 1 row or it's priority.  
All methods of the model which is a 'com.jidesoft.grid.SortableTableModel' and the Java interfaces implemented by it that might be able to return ALL rows where tried but to no avail.  
Am I missing something: e.g. another hidden table like the $1, a select cursor into the table as in a query that I have to "move next", or something else.

Thanks for any response.

---

<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:** [February 26, 2025, 8:25pm UTC](https://forum.inductiveautomation.com/t/reading-data-from-gui-alarmstatustable-to-check-cell-style/102930/2 "2025-02-26T20:25:56Z")

</div>

Consider working from this snippet (might need some slight adjustment) to retrieve the underlying model more directly:

> [@Alarm Journal Export](https://forum.inductiveautomation.com/t/alarm-journal-export/102512/4):
>
> Untested, but should work. from org.apache.commons.lang3.reflect import FieldUtils alarmJournal = event.source.parent.getComponent('Alarm Journal') model = FieldUtils.readField(alarmJournal, "model", True) data = FieldUtils.readField(model, "data", True) ds = data.getDataset()

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [April 2, 2025, 9:44am UTC](https://forum.inductiveautomation.com/t/reading-data-from-gui-alarmstatustable-to-check-cell-style/102930/3 "2025-04-02T09:44:54Z")

</div>

> [@iwan.tolboom](#):
>
> but when there are 8 active alarms visible in the table, at most 1 line is returned with `model.getRowCount()`

Hmmm; I can't replicate this result. When I run the following code from a test button, the correct row count for the table is returned:

```python
def getInnerTable(outerTable):
	for component in outerTable.components:
		if component. __class__. __name__ == 'AlarmStatusTable$1':
			return component
		else:
			innerTable = getInnerTable(component)
			if innerTable:
				return innerTable
		
outerTable = event.source.parent.getComponent('Alarm Status Table')
innerTable = getInnerTable(outerTable)
model = innerTable.model
print model.rowCount

```
