Ok, so ill try to keep this brief.
I have a flex repeater that accepts a SQL Query as a Json file. This is my Database query:
select station_number as “StationNum”, “” as “StationState” from stations
I added the “StationState” because I want to sort my Json, so that the repeater puts some of them at the bottom of the list, depending on the value of “StationState”, and the only way I know how to dynamically sort the Flex Repeater is with a Dynamic Json file.
So what ive decided to try to do is use a For repeater to add the values of the Tags to each row of the table, and then sort it. Ive been working on it for a while and just cant come up with the right answer. This is what Ive come up with so far:
pyData = system.dataset.toPyDataSet(value)
for row in range(value.getRowCount()): count = row +1 Tag = system.tag.readBlocking("[default]GoldSim/Station "+ str(count) +"/State tag") NewData = system.dataset.setValue(value, row, "StationState", Tag) return NewData
Is there a easier way to do this? It feels like I’m missing something simple here. Now I think I have to convert the Dataset back to a Json, but im not sure how to do that.
Im quite new to Python and working with Databases/Datasets, so any help would be great.