Variable to Template Canvas parameter

Using the template canvas customizer when you add a template that has parameters it will give you text boxes for each parameter, and will create a new column in the templates property.

In your case you would have one text box for ID (or whatever you’ve given for the name of your ID parameter).

Putting a static value of 1 into the text box will produce a value in the parameters column for that template of: {‘ID’:1}

In order for you to change the ID field dynamically based on some event you will need to modify the parameters column in the dataset by scripting or by returning the field with a query if you have bound the data property in that way.

Scripting

#filter event for the change of a custom property on the template canvas 
if event.propertyName == 'id':
	#get a referrence to the template canvas templates property
	dsTemps = event.source.templates
	
	#itterate throgh the data set, here you can filter for a specific template
	#or update all at once
	for row in range(dsTemps.rowCount):
		dsTemps = system.dataset.setValue(dsTemps,row,'parameters',event.newValue)
		
	event.source.templates = dsTemps

Or you can do it in the intializeTemplate extension function as well.

If you’ve bound the templates property to a query then you will need to return a parameters column with the query, with the value being equal to {‘id’:(rowID)}.