# Perspective Memory String Array Write

**URL:** <https://forum.inductiveautomation.com/t/perspective-memory-string-array-write/74780>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [June 8, 2023, 5:44pm UTC](https://forum.inductiveautomation.com/t/perspective-memory-string-array-write/74780 "2023-06-08T17:44:12Z")\
**Posts on this page:** 13\
**Page:** 2

<div class="post-metadata">

**Author:** ![Grace\_Tarler](https://avatars.discourse-cdn.com/v4/letter/g/f0a364/32.png) [@Grace\_Tarler](https://forum.inductiveautomation.com/u/Grace_Tarler)\
**Post date:** [June 9, 2023, 1:16pm UTC](https://forum.inductiveautomation.com/t/perspective-memory-string-array-write/74780/22 "2023-06-09T13:16:48Z")

</div>

Thank you so much for all the help! I don't know why I didn't think about needing to be more descriptive for the next person in order for the read through. I will take this all in and use it!

This is all to look through a drop down and get the selected supervisors name and email in order to then write it to a tag so that I can have an alert go off and make an expression rooster in order for a pipeline to send an email to a unique roster.

---

<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:** [June 9, 2023, 1:55pm UTC](https://forum.inductiveautomation.com/t/perspective-memory-string-array-write/74780/23 "2023-06-09T13:55:33Z")

</div>

That's the how, not the why/what.

Is the goal to have a specific user-configurable roster for a specific alarm ?

---

<div class="post-metadata">

**Author:** ![Grace\_Tarler](https://avatars.discourse-cdn.com/v4/letter/g/f0a364/32.png) [@Grace\_Tarler](https://forum.inductiveautomation.com/u/Grace_Tarler)\
**Post date:** [June 9, 2023, 2:40pm UTC](https://forum.inductiveautomation.com/t/perspective-memory-string-array-write/74780/24 "2023-06-09T14:40:03Z")

</div>

yep

---

<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:** [June 9, 2023, 2:45pm UTC](https://forum.inductiveautomation.com/t/perspective-memory-string-array-write/74780/25 "2023-06-09T14:45:02Z")

</div>

I kinda feel like this should be in a database table instead...

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [June 9, 2023, 2:47pm UTC](https://forum.inductiveautomation.com/t/perspective-memory-string-array-write/74780/26 "2023-06-09T14:47:13Z")

</div>

Also, for people newer to Python ChatGPT can help you re-write nested for/if statements in a more Pythonic way using list comprehension.

It's totally readable, but coming up with things like the list comprehension you see in my script below on my own when I first started with Python would've been very difficult.

```auto
def getSensorList():
	# get all tags in the analog folder
	tags2 = system.tag.browse("[default]Analog_Sensors", {'typeId':'Scaled_Analog_2SP', 'tagType':'udtInstance'}).results
	tags4 = system.tag.browse("[default]Analog_Sensors", {'typeId':'Scaled_Analog_4SP', 'tagType':'udtInstance'}).results
	
	tags = tags2 + tags4
	
	# extract tag names and descriptions
	names = [str(t['name']) for t in tags]
	tag_paths = [str(t['fullPath']) + "/Parameters.Name_SA2SP" for t in tags]
	desc = [str(d.value) for d in system.tag.readBlocking(tag_paths)]
	
	# create dataset
	headers = ["Description", "Tag Name"]
	data = [[desc,name] for desc, name in zip(desc, names)]
	dataset = system.dataset.toDataSet(headers, data)
	
	#print headers
	#print data
	
	return dataset

```

It might not get it right the first time. You can try feeding errors back into it, but I've not had much luck with that. ChatGPT is really only useful for simplifying small pieces of code.

---

<div class="post-metadata">

**Author:** ![Grace\_Tarler](https://avatars.discourse-cdn.com/v4/letter/g/f0a364/32.png) [@Grace\_Tarler](https://forum.inductiveautomation.com/u/Grace_Tarler)\
**Post date:** [June 9, 2023, 2:48pm UTC](https://forum.inductiveautomation.com/t/perspective-memory-string-array-write/74780/27 "2023-06-09T14:48:17Z")

</div>

Honestly that was my first thought when creating this but thought this would work and just started going with it

---

<div class="post-metadata">

**Author:** ![Grace\_Tarler](https://avatars.discourse-cdn.com/v4/letter/g/f0a364/32.png) [@Grace\_Tarler](https://forum.inductiveautomation.com/u/Grace_Tarler)\
**Post date:** [June 9, 2023, 2:48pm UTC](https://forum.inductiveautomation.com/t/perspective-memory-string-array-write/74780/28 "2023-06-09T14:48:51Z")

</div>

Thank you! I have been using it a bit when I have gotten stuck and couldn't figure out something. Definitely will give try for condensing code.

---

<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:** [June 9, 2023, 2:52pm UTC](https://forum.inductiveautomation.com/t/perspective-memory-string-array-write/74780/29 "2023-06-09T14:52:03Z")

</div>

I feel like I'm the only one who hasn't tried chat GPT yet.

And the worst/best part is I registered for the GPT-3 beta years ago and received a key/whatever is was... and never used it.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 9, 2023, 2:54pm UTC](https://forum.inductiveautomation.com/t/perspective-memory-string-array-write/74780/30 "2023-06-09T14:54:21Z")

</div>

> [@pascal.fragnoud](#):
>
> I feel like I'm the only one who hasn't tried chat GPT yet.

You aren't the only one. I refuse to use it, because you can't tell when it makes [expletive] up unless you already knew the answer to begin with.

{ And I refuse to participate if someone brings AI output to me and asks me to help "fix" it. }

---

<div class="post-metadata">

**Author:** ![Grace\_Tarler](https://avatars.discourse-cdn.com/v4/letter/g/f0a364/32.png) [@Grace\_Tarler](https://forum.inductiveautomation.com/u/Grace_Tarler)\
**Post date:** [June 9, 2023, 3:14pm UTC](https://forum.inductiveautomation.com/t/perspective-memory-string-array-write/74780/31 "2023-06-09T15:14:38Z")

</div>

I feel like a lot of times it is great to get a baseline if you are lost to where you should even start. Or check your code and find the little mistakes that you made syntax so you aren't just staring at your screen for hours.

---

<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:** [June 9, 2023, 3:16pm UTC](https://forum.inductiveautomation.com/t/perspective-memory-string-array-write/74780/32 "2023-06-09T15:16:25Z")

</div>

Staring at your screen for hours is how you learn how not to make those mistakes anymore, though ;p

---

<div class="post-metadata">

**Author:** ![Grace\_Tarler](https://avatars.discourse-cdn.com/v4/letter/g/f0a364/32.png) [@Grace\_Tarler](https://forum.inductiveautomation.com/u/Grace_Tarler)\
**Post date:** [June 9, 2023, 3:18pm UTC](https://forum.inductiveautomation.com/t/perspective-memory-string-array-write/74780/33 "2023-06-09T15:18:44Z")

</div>

so true though, the mistakes that spent me hours to find I'll like never do again since constantly thinking about

---

<div class="post-metadata">

**Author:** ![Tim\_Carlton](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tim_carlton/32/52835_2.png) [@Tim\_Carlton](https://forum.inductiveautomation.com/u/Tim_Carlton)\
**Post date:** [June 9, 2023, 5:47pm UTC](https://forum.inductiveautomation.com/t/perspective-memory-string-array-write/74780/34 "2023-06-09T17:47:37Z")

</div>

> [@pascal.fragnoud](#):
>
> Staring at your screen for hours is how you learn how not to make those mistakes anymore, though

Using a modern language and a modern dev environment is another way.

[Previous page](https://forum.inductiveautomation.com/t/perspective-memory-string-array-write/74780.md?page=1)
