Basics -template drop parameter

i have a template with integer parameter which then uses indirect tags binding with this parameter to the UDT. i could not drop the instance of the UDT on screen and create an instance until i added UDT as second parameter to the template. Is it necessary? Using template repeater would work without second parameter i guess.
Second thing is I am using internal parameter to do some complex calculation which then provides an output which can be used in the template but i guess if i knew how to do it i could do the calculation directly in the binding and there would be no need to use internal parameter- is it right? What is the true purpose of the internal parameters?


Yes, the tag must have the same type as the parameter of a template set to be a drop target in order to see the option when dragging that tag or UDT onto a window. The actual value for the tag being dragged and dropped is what is passed into the parameter, or in the case of a UDT, the UDT's structure.

Often it is undesirable to pass a whole UDT as that can have far more tags than you actually need in a single template, so using a template repeater like you've said if that makes sense can be more lightweight. You could also rethink your template indirect binding--if you really wanted to set up drop targets for tags for easy designing, you could add a string memory tag to your UDT with the value bound to the {PathToParentFolder} built in parameter of the UDT, and use a string drop target parameter in your UDT. Then, when you drag and dropped that string tag, the parameter passed in would be the path to the UDT, which you can use to set up your bindings. Many ways to do this, really depends on your use case.

As far as the internal parameters of a template go, you can think of them as a global variable for the template itself and the components within. Similar to custom properties on a regular window, the template internal parameters can be a single place a value is stored that is useful for many components within to be able to reference. You'd use an internal parameter when the value being referenced isn't coming from an outside source like a template parameter, and doesn't need to be referenced by anything outside the template either.

Internal parameters are not strictly necessary, you could always just reference properties on the components directly, but it can be much easier to maintain one source of truth rather than tracking down stuff in between individual components.

that was very helpful - thanks