# Sorting a table or sorting incoming data?

**URL:** <https://forum.inductiveautomation.com/t/sorting-a-table-or-sorting-incoming-data/91011>\
**Category:** Ignition\
**Tags:** scripting, perspective\
**Created:** [May 28, 2024, 2:31pm UTC](https://forum.inductiveautomation.com/t/sorting-a-table-or-sorting-incoming-data/91011 "2024-05-28T14:31:19Z")\
**Posts on this page:** 7\
**Page:** 3

<div class="post-metadata">

**Author:** ![The\_Bit\_Plumber](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/the_bit_plumber/32/58166_2.png) [@The\_Bit\_Plumber](https://forum.inductiveautomation.com/u/The_Bit_Plumber)\
**Post date:** [June 4, 2024, 1:52pm UTC](https://forum.inductiveautomation.com/t/sorting-a-table-or-sorting-incoming-data/91011/42 "2024-06-04T13:52:59Z")

</div>

> Have you defined `myLogger` further up in the script? If not then this wont work.

I did not. If I add the quotes around it, it should work correct?

---

<div class="post-metadata">

**Author:** ![keithms](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/keithms/32/58243_2.png) [@keithms](https://forum.inductiveautomation.com/u/keithms)\
**Post date:** [June 4, 2024, 1:53pm UTC](https://forum.inductiveautomation.com/t/sorting-a-table-or-sorting-incoming-data/91011/43 "2024-06-04T13:53:59Z")

</div>

I don't want to take this thread further off-topic, but a close example of SQLite in action that is familiar to everyone here is Ignition's own logs. The backing storage for these logs is a SQLite database.

---

<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:** [June 4, 2024, 1:54pm UTC](https://forum.inductiveautomation.com/t/sorting-a-table-or-sorting-incoming-data/91011/44 "2024-06-04T13:54:49Z")

</div>

Well that call at least should work.

Also, I edited my reply, did you see this?

> [@lrose](#):
>
> The only way I can see that rows are entered as null, is if dataOut is empty (doesn't seem likely I would expect an error, not a null entry) either way, do all of the messages have two newLines in them? `for item in message.split('\n\n')`

---

<div class="post-metadata">

**Author:** ![The\_Bit\_Plumber](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/the_bit_plumber/32/58166_2.png) [@The\_Bit\_Plumber](https://forum.inductiveautomation.com/u/The_Bit_Plumber)\
**Post date:** [June 4, 2024, 3:09pm UTC](https://forum.inductiveautomation.com/t/sorting-a-table-or-sorting-incoming-data/91011/45 "2024-06-04T15:09:45Z")

</div>

> [@lrose](#):
>
> The only way I can see that rows are entered as null, is if dataOut is empty (doesn't seem likely I would expect an error, not a null entry) either way, do all of the messages have two newLines in them? `for item in message.split('\n\n')`

Yes I beleive they do, here's a code snippet of how they are formatted. It's a newline and another one back to back.

```python
  if not found_in_aoi:
            # Print the message that the tag was identified but not in any sector
            message = f"Tag ID: {hit_name} was identified, but it is not in any sector at {formatted_time}"
        
        result.append(message + "\n")
    
    messages = "\n".join(result)
    
    return messages

```

the variable _messages_ is what is used to make up the data packet.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [June 6, 2024, 11:31am UTC](https://forum.inductiveautomation.com/t/sorting-a-table-or-sorting-incoming-data/91011/46 "2024-06-06T11:31:18Z")

</div>

> [@Francisco.Mejia](#):
>
> affecting the performance of the client.

Should be alleviated with this:

> [@The\_Bit\_Plumber](#):
>
> Ok, so I downloaded POSTgres DB,

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [June 6, 2024, 11:32am UTC](https://forum.inductiveautomation.com/t/sorting-a-table-or-sorting-incoming-data/91011/47 "2024-06-06T11:32:45Z")

</div>

Let's step back a moment. In what table is _message_ being stored? According to the screenshot it's going into _parsed\_data_. I would think it be saving into raw\_data

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/9/293772fcd8ea5fc0f512ec82bf1651120a1f0138.png)

---

<div class="post-metadata">

**Author:** ![Francisco.Mejia](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/francisco.mejia/32/63246_2.png) [@Francisco.Mejia](https://forum.inductiveautomation.com/u/Francisco.Mejia)\
**Post date:** [June 7, 2024, 2:11pm UTC](https://forum.inductiveautomation.com/t/sorting-a-table-or-sorting-incoming-data/91011/48 "2024-06-07T14:11:55Z")

</div>

You can download SQL Server developer edition which is the real thing but not to be used for commercial purposes. SQL Express is OK but has a 10 gig database limit

[Previous page](https://forum.inductiveautomation.com/t/sorting-a-table-or-sorting-incoming-data/91011.md?page=2)
