Using a variable with Twig include I am trying to use a variable, based on an entry field, to load a form with a Twig include. The code is pretty straightforward:

{% set theForm = entry.formSelect %}
{% include theForm %}


Doing this throws this error:


  Undefined property: Craft\SingleOptionFieldData::$cacheKey


If I print the variable, it looks exactly as you would expect, e.g. forms/_basic

Any suggestions would be appreciated!
You need to let Twig interpret the variable as a string. This works for me: 

{% set theForm = entry.formSelect %}
{% include ''~theForm~'' %}


Hope this helps!