I have a table component in perspective, showing different tags of different equipment.
Now for testing I have configured the DATA prop of the table manually, linking the fields with the Tags in the Tag browser.
But this is not going to be possible for hundreds of tags, so I would like to build an script to add this bindings automatically.
Is there a way to add a binding? for the moment I read the tags I need with system.tag.readblocking() and I assign those values to the prop.data of the table, but this is not a dynamic way to bind, if the tag changes, the value will not be shown.
You'd then configure 2 column objects tagName and tagValue. This will populate your table with tags from your tag provider. You can check out this thread, I think there could be a lot of useful info for you;
If you don't need the values to be refreshed in "real time", you can generate the table by reading all the tags as described by @Fran_Dujmovic, and refresh it every x seconds.
If you want to have actual bindings to each tags, you can't script that in ignition, but you can generate the configuration with a script.
You can configure a row, with its bindings, then copy the table and paste it in an editor so you can see what it looks like. It's in json format.
Modify it with a script, then copy the resulting json and paste it back in your view.
thanks for your reply, It looks like this is the best solution but I don't understand how can I add a binding using a render cell view, could you please send me an example or clarify it a bit deeper for me as a beginner?
In the view you create to be nested in the table to show the live data, make sure you define input parameters named value or rowData. (Exactly those names.)
For testing that view, place a tag path in value, or a complete row of data from the table's props.data into rowData.
Use indirect binding within the view to point at the correct tag for that cell.