# Need advise on adding tags to Ignition

**URL:** <https://forum.inductiveautomation.com/t/need-advise-on-adding-tags-to-ignition/99143>\
**Category:** Ignition\
**Created:** [November 26, 2024, 7:02pm UTC](https://forum.inductiveautomation.com/t/need-advise-on-adding-tags-to-ignition/99143 "2024-11-26T19:02:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Grigory\_Vogman](https://avatars.discourse-cdn.com/v4/letter/g/278dde/32.png) [@Grigory\_Vogman](https://forum.inductiveautomation.com/u/Grigory_Vogman)\
**Post date:** [November 26, 2024, 7:02pm UTC](https://forum.inductiveautomation.com/t/need-advise-on-adding-tags-to-ignition/99143/1 "2024-11-26T19:02:01Z")

</div>

Hi everyone,

I am new to Ignition so I apologize if answer to my question is obvious...

So I am trying to add a list of 50 "accounts" with non-sequential numerical numbers. Each "account" should have 6 Boolean tags. Like in "invoice received for this month" yes/no.

I currently have this data in excel/CSV file formatted like:  
"Account number", "Invoice for this month 1/0", "Invoice for last month 1/0", "Invoice for this month minus two 1/0", etc.  
Basically first column for the "account" # and then six columns with 1 or 0.

What is the best way to do it? Manually eneter 50 folders with tags? Create a UDT? Create one, export JSON file, edit it, import back? Some other way to do it?

Thank you for all responses.

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [November 26, 2024, 7:44pm UTC](https://forum.inductiveautomation.com/t/need-advise-on-adding-tags-to-ignition/99143/2 "2024-11-26T19:44:21Z")

</div>

Are you required to have each account as a separate folder? Will you ever add or remove accounts?

Also, to make sure I and others understand correctly: Is this a one time occurrence or will you be doing this once every month (or some other time period)? Are you trying to use this CSV to pull data into Ignition?

This honestly sounds like something you could condense into a single dataset tag, with the columns of your CSV lining up with the columns of the dataset.

If you are dead set on using folders for each account, use [`system.tag.configure`](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-tag/system-tag-configure) to build out the folders and tags via scripting.

For getting the data from the csv into these tags, you can write a script to parse the CSV and build the tag paths to use with [`system.tag.writeBlocking`](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-tag/system-tag-writeBlocking) to write the data to the tags in the folders.

You can go so far as to make sure the CSV will always be in a folder that Ignition can reach and write a scheduled gateway script to parse the CSV in that folder at a specific time each month to grab the new data.

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [November 26, 2024, 7:44pm UTC](https://forum.inductiveautomation.com/t/need-advise-on-adding-tags-to-ignition/99143/3 "2024-11-26T19:44:34Z")

</div>

Sounds like a good job for SQL vs tags.

---

<div class="post-metadata">

**Author:** ![Grigory\_Vogman](https://avatars.discourse-cdn.com/v4/letter/g/278dde/32.png) [@Grigory\_Vogman](https://forum.inductiveautomation.com/u/Grigory_Vogman)\
**Post date:** [November 26, 2024, 7:55pm UTC](https://forum.inductiveautomation.com/t/need-advise-on-adding-tags-to-ignition/99143/4 "2024-11-26T19:55:36Z")

</div>

1. No, it does not have to be a folder for each account. But I need each account to have 6 boolean values connected to it. Add/Remove accounts - yes, but rarely.
2. Ideally I would do this every month. Yes, I am trying to use CSV to pull data into ignition from a different system. I can either download excel/csv report from there or access it via API.

> [@ryan.white](#):
>
> This honestly sounds like something you could condense into a single dataset tag, with the columns of your CSV lining up with the columns of the dataset.

Can you tell me more or direct me to a resource to learn more about this?

> [@ryan.white](#):
>
> You can go so far as to make sure the CSV will always be in a folder that Ignition can reach and write a scheduled gateway script to parse the CSV in that folder at a specific time each month to grab the new data.

If I understand this correctly, than it's the ultimate goal. I hope to create a script to populate the CSV periodically and then create a script within Ignition to pull data from that CSV.

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [November 26, 2024, 8:17pm UTC](https://forum.inductiveautomation.com/t/need-advise-on-adding-tags-to-ignition/99143/5 "2024-11-26T20:17:33Z")

</div>

> [@Grigory\_Vogman](#):
>
> Can you tell me more or direct me to a resource to learn more about this?

> **[system.dataset.toDataSet | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-dataset/system-dataset-toDataSet#syntax---create-from-list)**
>
> This function is used to 1. Convert PyDataSets to DataSets 2. Create new datasets from raw Python lists. When creating a new dataset, headers should have unique names.

That's the manual page on the function to create a new dataset.

Just to confirm, is this an actual CSV file or is it an excel file (.xls or .xlsx) with the data formatted in the same way as a CSV?

You can do a search for `CSV to dataset` here on the forums and get some decent information.

[https://forum.inductiveautomation.com/search?q=csv%20to%20dataset](https://forum.inductiveautomation.com/search?q=csv%20to%20dataset)

This post looks like it has a basic script for converting csv to dataset:

> [@Upload csv to dataset](https://forum.inductiveautomation.com/t/upload-csv-to-dataset/79797/2):
>
> Figured it out, Not sure why I got hung up like I did. If anyone else gets stuck: the following class can parse csv files and store as a dataset: class CSVParser: def \_\_init\_\_(self, file\_in): self.file = file\_in self.file\_string = file\_in.getString() self.rows = [row.split(',') for row in self.file\_string.split('\r')] self.num\_cols = max([len(row) for row in self.rows]) self.num\_rows = len(self.rows) self.headers = self.rows[0] self.data = self.rows[1:] @property def extend…

That class is expecting the result from a file upload component, you would need to modify it to accept the output of [`system.file.readFileAsString`](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-file/system-file-readFileAsString)

> [@Grigory\_Vogman](#):
>
> I hope to create a script to populate the CSV periodically

What is the source of this CSV? Is it being exported from some other program? If so it may be worth seeing if you can get this program to dump this data into a database table. That would make things simpler as you could use a query tag to hold the information and eliminate the script on Ignition's side.

I also understand that you may be limited to only CSV files. My company has several CSV files that we use Ignition to parse and chuck into a DB table on a weekly or daily basis.

---

<div class="post-metadata">

**Author:** ![Grigory\_Vogman](https://avatars.discourse-cdn.com/v4/letter/g/278dde/32.png) [@Grigory\_Vogman](https://forum.inductiveautomation.com/u/Grigory_Vogman)\
**Post date:** [November 27, 2024, 1:30pm UTC](https://forum.inductiveautomation.com/t/need-advise-on-adding-tags-to-ignition/99143/6 "2024-11-27T13:30:55Z")

</div>

Ryan, Thank you for so much info. I am reading through it right now. I really appreciate your help.

> [@ryan.white](#):
>
> Just to confirm, is this an actual CSV file or is it an excel file (.xls or .xlsx) with the data formatted in the same way as a CSV?

Currently it is an Excel file report with weird formatting (a lot of merged and hidden cells for better looks) that I cleaned up to leave only needed columns (account identifier and 1/0 for six months). I am planning to pull the same data via API and save as CSV. The data is pulled from the cloud-based software we use for Utility Billing tracking. I don't think Ignition can pull date over API (at least it was not covered in the class).

> [@ryan.white](#):
>
> What is the source of this CSV? Is it being exported from some other program? If so it may be worth seeing if you can get this program to dump this data into a database table. That would make things simpler as you could use a query tag to hold the information and eliminate the script on Ignition's side.

as I said, currently it's a built-in report in a different software. But I hope to start pulling it via API eventually, so I might be able to dump it in a database table, but it is much further down the road.

> [@ryan.white](#):
>
> I also understand that you may be limited to only CSV files. My company has several CSV files that we use Ignition to parse and chuck into a DB table on a weekly or daily basis.

I guess, my goal is to do something similar.

---

<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:** [November 27, 2024, 1:56pm UTC](https://forum.inductiveautomation.com/t/need-advise-on-adding-tags-to-ignition/99143/7 "2024-11-27T13:56:03Z")

</div>

> [@Grigory\_Vogman](#):
>
> I don't think Ignition can pull date over API (at least it was not covered in the class).

Yes, it can. Start here: [system.net.httpClient()](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-net/system-net-httpClient)
