addFieldVariables not functioning with string data I have the following code:

    {% set query = {} %}

     {% if not craft.request.getParam('q')|length %}
          {#.. key, value pairing .. #}
          {% set query = query | merge({(key):(value)}) %}
     {% else %}
          {% set query = craft.request.getParam('q') %}
     {% endif %}

     {% set queryStr = query|join(' OR ') %}

     {% do craft.sproutForms.addFieldVariables({ queryStr: queryStr }) %}   

     {{ craft.sproutForms.displayForm('requestcsv') }}


When I add {{queryStr}} to my hidden field in requestcsv, it doesn't populate. I can output {{queryStr}} on the page, and even so, it doesn't get passed.

Is there something I'm missing in order to be able to pass this string to a hidden field? {{queryStr}} is just a plain string.
The value you place in your Hidden Field settings gets treated as a template and whatever values you pass o the addFieldVariables method are treated as the object that gets parsed by that template.

Just like, when you load an Entry page in Craft, Craft provides the entry variable to the template, when we process the Hidden Field settings, Sprout Forms provides the addFieldVariables variables to that template.

While Craft knows it is giving you an Entry and names it's variable entry, Sprout Forms doesn't really know what you might be giving it, so it names the variable available to your settings template a generic term: object.

You can access these values using Object Syntax, in the same way you can using the Title Format behavior for Sections:

{{ object.variableName }}


Or in your case:

{{ object.queryStr }}


In some cases, you can also use a shorthand to output the value with a single curly brace: {queryStr}.