How to dynamically set an include template I have a series of structure items, each with a product id, based on this id I would like to load in an additional template.

Something like this:

{% set embedAsset = entry.productId %}
{% include "embedAsset" %}


Any ideas?
Your code should work if you remove the quotation marks enclosing your variable.

{% set embedAsset = entry.productId %}
{% include embedAsset %}


If you want, you can use string concatenation to add a path or extension to it.

{% set embedAsset = '_products/' ~ entry.productId ~ '.html' %}
{% include embedAsset %}


You could also add a "fallback template", that loads in case your dynamic template does not exist (read the Twig docs for more info about this).

{% set embedAsset = '_products/' ~ entry.productId ~ '.html' %}
{% set defaultAsset = '_products/default.html' %}
{% include([embedAsset, defaultAsset]) %}