# Iterating through array(com.inductiveautomation.ignition.common.model.values.QualifiedValue)

**URL:** <https://forum.inductiveautomation.com/t/iterating-through-array-com-inductiveautomation-ignition-common-model-values-qualifiedvalue/40021>\
**Category:** Ignition\
**Created:** [October 26, 2020, 4:25pm UTC](https://forum.inductiveautomation.com/t/iterating-through-array-com-inductiveautomation-ignition-common-model-values-qualifiedvalue/40021 "2020-10-26T16:25:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wking](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wking/32/21823_2.png) [@wking](https://forum.inductiveautomation.com/u/wking)\
**Post date:** [October 26, 2020, 4:25pm UTC](https://forum.inductiveautomation.com/t/iterating-through-array-com-inductiveautomation-ignition-common-model-values-qualifiedvalue/40021/1 "2020-10-26T16:25:45Z")

</div>

I have a script

```auto
server = "Ignition OPC UA Server"
machina = "D24"
indexer = range(32)

pathArray = []
for i in indexer:
	path = "ns=1;s=[%s]Global.UnitData.Plug.Plug[%s].Station" %(machina,i)
	pathArray.append(path)

qualifiedValue = system.opc.readValues(server, pathArray)
print qualifiedValue

```

That returns a list like so…

```auto
array(com.inductiveautomation.ignition.common.model.values.QualifiedValue, 
[
    [1, Good, Mon Oct 26 11:22:54 CDT 2020 (1603729374826)],
    [2, Good, Mon Oct 26 11:22:54 CDT 2020 (1603729374826)], 
    [0, Good, Mon Oct 26 11:22:54 CDT 2020 (1603729374826)], 
    [3, Good, Mon Oct 26 11:22:54 CDT 2020 (1603729374826)], 
    [4, Good, Mon Oct 26 11:22:54 CDT 2020 (1603729374826)], 
    [0, Good, Mon Oct 26 11:22:54 CDT 2020 (1603729374826)], 
    [5, Good, Mon Oct 26 11:22:54 CDT 2020 (1603729374826)], 
    [6, Good, Mon Oct 26 11:22:54 CDT 2020 (1603729374826)],
    [0, Good, Mon Oct 26 11:22:54 CDT 2020 (1603729374826)], 
    [7, Good, Mon Oct 26 11:22:54 CDT 2020 (1603729374826)], 
    [8, Good, Mon Oct 26 11:22:54 CDT 2020 (1603729374826)],
    [9, Good, Mon Oct 26 11:22:54 CDT 2020 (1603729374826)], 
    [10, Good, Mon Oct 26 11:22:54 CDT 2020 (1603729374826)], 
    [0, Good, Mon Oct 26 11:22:54 CDT 2020 (1603729374826)],  
    [11, Good, Mon Oct 26 11:22:54 CDT 2020 (1603729374826)], 
    [12, Good, Mon Oct 26 11:22:54 CDT 2020 (1603729374826)], 
    [0, Good, Mon Oct 26 11:22:54 CDT 2020 (1603729374826)], 
    [13, Good, Mon Oct 26 11:22:54 CDT 2020 (1603729374826)],
    [0, Good, Mon Oct 26 11:22:54 CDT 2020 (1603729374826)],
    [14, Good, Mon Oct 26 11:22:54 CDT 2020 (1603729374826)],
    [15, Good, Mon Oct 26 11:22:54 CDT 2020 (1603729374826)], 
    [16, Good, Mon Oct 26 11:22:54 CDT 2020 (1603729374826)],
    [0, Good, Mon Oct 26 11:22:54 CDT 2020 (1603729374826)],
    [0, Good, Mon Oct 26 11:22:54 CDT 2020 (1603729374826)], 
    [0, Good, Mon Oct 26 11:22:54 CDT 2020 (1603729374826)],
    [0, Good, Mon Oct 26 11:22:54 CDT 2020 (1603729374826)], 
    [0, Good, Mon Oct 26 11:22:54 CDT 2020 (1603729374826)],
    [0, Good, Mon Oct 26 11:22:55 CDT 2020 (1603729375826)],
    [0, Good, Mon Oct 26 11:22:55 CDT 2020 (1603729375826)],
    [0, Good, Mon Oct 26 11:22:55 CDT 2020 (1603729375826)],
    [0, Good, Mon Oct 26 11:22:55 CDT 2020 (1603729375826)],
    [0, Good, Mon Oct 26 11:22:55 CDT 2020 (1603729375826)]
])

```

or

```auto
for items in qualifiedValue:
	items.getValue()

```

```auto
1
2
0
3
4
0
5
6
0
7
8
9
10
0
11
12
0
13
0
14
15
16
0
0
0
0
0
0
0
0
0
0

```

how can I search this array for a value? Say 10. And return its index? or its OPC path?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [October 26, 2020, 4:28pm UTC](https://forum.inductiveautomation.com/t/iterating-through-array-com-inductiveautomation-ignition-common-model-values-qualifiedvalue/40021/2 "2020-10-26T16:28:33Z")

</div>

Did you forget the question part of your post?

---

<div class="post-metadata">

**Author:** ![wking](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wking/32/21823_2.png) [@wking](https://forum.inductiveautomation.com/u/wking)\
**Post date:** [October 26, 2020, 4:29pm UTC](https://forum.inductiveautomation.com/t/iterating-through-array-com-inductiveautomation-ignition-common-model-values-qualifiedvalue/40021/3 "2020-10-26T16:29:21Z")

</div>

yeah hold up accidently summited question when I was editing.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [October 26, 2020, 4:43pm UTC](https://forum.inductiveautomation.com/t/iterating-through-array-com-inductiveautomation-ignition-common-model-values-qualifiedvalue/40021/4 "2020-10-26T16:43:50Z")

</div>

You can get the index like this:

```auto
# get a list of the actual values out of the QualifiedValue list
values = [qv.value for qv in qvs]

# find the index of the value 2 in values list
index = values.index(2)

# do something with that index
...

```
