# Need help making a list

**URL:** <https://forum.inductiveautomation.com/t/need-help-making-a-list/93804>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [July 26, 2024, 5:22pm UTC](https://forum.inductiveautomation.com/t/need-help-making-a-list/93804 "2024-07-26T17:22:47Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![PrestonS](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/prestons/32/28432_2.png) [@PrestonS](https://forum.inductiveautomation.com/u/PrestonS)\
**Post date:** [July 26, 2024, 5:22pm UTC](https://forum.inductiveautomation.com/t/need-help-making-a-list/93804/1 "2024-07-26T17:22:47Z")

</div>

Hello I have 10 ovens that I want to make a list with. I have a tag that shows me how long the oven has remaining in seconds and I want to have the top of the list show which oven is going to be finished next.

I am new to ignition and don't know if this can be done so looking for some help on this thank you!

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [July 26, 2024, 5:30pm UTC](https://forum.inductiveautomation.com/t/need-help-making-a-list/93804/2 "2024-07-26T17:30:30Z")

</div>

Something like this:

```python
#assuming that ovens are numbered and start from 0
tagPaths = ['path/to/oven{}/timeremaining'.format(i) for i in range(numberOfOvens)]
ovens = [qv.value for qv in system.tag.readBlocking(tagPaths)]
return ovens.sort()

```

About the best I can do without a little more information about exactly where and what you're trying to accomplish.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [July 26, 2024, 5:35pm UTC](https://forum.inductiveautomation.com/t/need-help-making-a-list/93804/3 "2024-07-26T17:35:22Z")

</div>

I think you would return `ovens` and not the sort method. I've tripped over this one a few times

```python
ovens.sort()
return ovens

```

---

<div class="post-metadata">

**Author:** ![PrestonS](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/prestons/32/28432_2.png) [@PrestonS](https://forum.inductiveautomation.com/u/PrestonS)\
**Post date:** [July 26, 2024, 5:37pm UTC](https://forum.inductiveautomation.com/t/need-help-making-a-list/93804/4 "2024-07-26T17:37:44Z")

</div>

Hello thank you for your quick responses I think that I want to use the table component but need to know how or if I can sort the table by the value in the rows.

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

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [July 26, 2024, 5:38pm UTC](https://forum.inductiveautomation.com/t/need-help-making-a-list/93804/5 "2024-07-26T17:38:38Z")

</div>

Show the binding or script where the data for this table is coming from

---

<div class="post-metadata">

**Author:** ![PrestonS](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/prestons/32/28432_2.png) [@PrestonS](https://forum.inductiveautomation.com/u/PrestonS)\
**Post date:** [July 26, 2024, 5:40pm UTC](https://forum.inductiveautomation.com/t/need-help-making-a-list/93804/6 "2024-07-26T17:40:06Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/a/cad40dc3de998111bc9170888e5e25e2dbb23ae0.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/8/d8908c77ffbfdd07f7eb8aa63064f2fd1b2fef1c.png)

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [July 26, 2024, 5:46pm UTC](https://forum.inductiveautomation.com/t/need-help-making-a-list/93804/7 "2024-07-26T17:46:41Z")

</div>

~~Try turning this into an expression binding, add the tag path and use a [sorting function](https://docs.inductiveautomation.com/docs/8.1/appendix/expression-functions/advanced/sortDataset).~~

~~ 

```python
sortDataset({tagPath}, 1)

```

 ~~

I misunderstood the binding, you have tags bound to each row of your table data.

---

<div class="post-metadata">

**Author:** ![PrestonS](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/prestons/32/28432_2.png) [@PrestonS](https://forum.inductiveautomation.com/u/PrestonS)\
**Post date:** [July 26, 2024, 5:50pm UTC](https://forum.inductiveautomation.com/t/need-help-making-a-list/93804/8 "2024-07-26T17:50:54Z")

</div>

Correct

---

<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:** [July 26, 2024, 5:53pm UTC](https://forum.inductiveautomation.com/t/need-help-making-a-list/93804/9 "2024-07-26T17:53:27Z")

</div>

If the list of ovens won't change (often) make an expression structure binding, bring in all the ovens as separate elements, then use a transform script similar to the one posted above to transform into a structure the table expects.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [July 26, 2024, 6:21pm UTC](https://forum.inductiveautomation.com/t/need-help-making-a-list/93804/10 "2024-07-26T18:21:18Z")

</div>

As @paul-griffith says, create an expression structure binding. Add an object member for each oven, and add an expression to read each tag.

For instance the expression for Oven1 would look like this:

```python
{[default]Ovens/Oven1/DEKEMA_Furnace_Status/OPC_UA_DATA_RestTimeTotal}

```

Then add a script transform with the following:

```python
return sorted([{'Oven':k,'Time_Remaining':v} for k,v in value.iteritems()], key=lambda oven:oven['Time_Remaining'])

```

---

<div class="post-metadata">

**Author:** ![PrestonS](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/prestons/32/28432_2.png) [@PrestonS](https://forum.inductiveautomation.com/u/PrestonS)\
**Post date:** [July 26, 2024, 6:41pm UTC](https://forum.inductiveautomation.com/t/need-help-making-a-list/93804/11 "2024-07-26T18:41:43Z")

</div>

Awesome, I ended up getting the table to sort through itself for now. I will be testing out the scripting method as well

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/0/706ee818b7a784e3e9b42f224b8e68c0995675dd.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/5/3528daf4835151c35124c784b225112a0ac84ea0.png)

---

<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 27, 2024, 8:58am UTC](https://forum.inductiveautomation.com/t/need-help-making-a-list/93804/12 "2024-07-27T08:58:44Z")

</div>

Frankly with only 10 ovens, I'd create the list manually and actually bind each value to its corresponding tag, then let the table sort things itself.
