Hello,
I have a dataset that i am first pulling from SQL, adding a column from a tag read, and then sorting. I want to get this into the Flex Repeater on perspective to allow it to show a view for every piece of equipment. The dataset is converted into a JSON in script.
However,, when i bind this to the Flex Repeater Instances object - it errors out.
I am thinking there is an issue with how i am converting the dataset into a JSON, any ideas? It doesn't appear to have the right file format for the Flex Repeater - but i am unsure on how to get this format
The data you are giving to the instances prop appears to be coming out as a single dictionary, the instances prop expects an array(list of dictionaries), so you'll need to adjust your transform script to return your results as such.
You appear to be json encoding a dataset in your transform script, which will not return what you are looking for.
if you don't care about the position properties or styles you can omit those.
Looking through your transform, a few things stand out other than the return format.
You have a line where you are building a tag path then immediately using a blocking read call to fetch the status of the machine. Consider instead passing this tag path to the flex instance as a parameter, and then having a custom property use this tag path in an indirect binding to fetch the tag value. Makes your transform simpler and faster.
Or if you must have the status value, consider using list comprehension to build the list of tag paths and use them in a single blocking read call.
Its just a library import. That is just so I can use the operator.itemgetter('key') function to use as the sort key for sorting the final array. It is supposed to be more performant/straightforward than making a lambda call.
Makes sense - trying to work with it a bit, but for whatever reason it isn't reading the status value it - as they are all null, so the sort function doesn't work.
Any ideas?
I have been working with it - but to be honest, don't quite understand why the tag isn't reading - since the path is correct.
You have a space at the very end of the tag path, does your tag actually have a space at the end of its name? That seems like it would be a typo rather than a naming convention.
You can test if the tag path is valid by copying one of them and then setting a custom test property to be a tag binding with the copied path.
Edit:
should be
statusValueTagPaths = ['[default]ACME/Station {0}/State '.format(value.getValueAt(x, 'station_number')) for x in xrange(value.rowCount)]
You only adjusted one of the tag paths to include the space at the end
Wow, i just saw that...
I screwed up when i made the UDT, and didn't catch it till now. Ugh - debating on changing the script or going back and finding all of the references....
Anyways - that you for all of your help - i really appreciate it!
ACME... this looks like a certification question... what is it with people trying to flout the rules lately?? I do wonder if these certs get thrown out or do they just a slap on the wrist with no consequence?
Yeah, ACME and "Station" are ringing major alarm bells to me, as these were a big part of the practical side. It's been a few years since I did mine though. I've been caught out in some of the recent posts that were taken down, as I didn't recognise them as from the certs. They must have updated them or my memory is failing.
It CLEARLY states it in the cert info though that asking questions on the forum is prohibited
Edit: This is from when I did my cert. Maybe it doesn't mention the forum, but it's pretty darn obvious you shouldn't be using it (or the help from peers, for that matter either)
Maybe this wording has changed and is less explicit??
Edit2: @Mike_Zylla This from a RECENT cert info sheet, and again, clearly states in no uncertain terms where you can get help from... It also states the repercussions of trying to flout the rules. I'm not sure how someone would think it's ok to try to cheat on a certification test? If you get help from anyone else, it's not proving that you're capable; it's proving that the other person is capable