Get Label text in template, from Template Repeater (Dataset - Template Parameters) SQL Query

Hey, I thought this would be simple enough to do, but I can’t seem to get it figured correctly. I have a tank template that has a ClyndricalTank component, a Text label (Tank Name), and a text field (current volume). This Tank Template is used in the template path for a template repeater.

The end result of what i want, is that a template repeater runs a query in a database that returns 2 columns based on the selected pad. The 2 columns are the tank name and tagpath that exist in a sql database. I would like the tank name to appear on the Tank Name Text Label in the Tank Template.

I can get the Template repeater to create the correct amount of instances based on the SQL query, and i can see the sql results in the dataset viewer for the Repeater’s Template paramenters, but I can’t figure out how to have the Tank names show up in the Tank Template.

Any ideas?

You need to set a custom property on the template that matches the name of the column in the dataset on the template repeater.

So if your query on the template repeater was something like…
Select tankName, tankCurrentVolume FROM tankTable WHERE pad = 4

You would then go to the template repeater and create two custom properties (ctrl+u). One named tankName and the other named tankCurrentVolume. Make sure the datatype of the custom property is compatible with the data coming from the database.

The custom property on the template can then be bound to the name and volume label.

Edit: Just saw the second column you specified was called tagpath, rather than tankCurrentVolume. The process for passing the data is the same.

Edit 2: If you haven’t already, check out Inductive University, this video is discussing precisely what you asked.

1 Like

Hey Stuart, thanks for your reply. i had checked out the University, but i didn’t infer that the template parameter or the template need to match the same name from the dataset columns, THanks