# Variables requested via survey always overwrite template defaults

**URL:** <https://forum.ansible.com/t/variables-requested-via-survey-always-overwrite-template-defaults/34725>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [March 5, 2021, 1:00pm UTC](https://forum.ansible.com/t/variables-requested-via-survey-always-overwrite-template-defaults/34725 "2021-03-05T13:00:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kdu\_Bonalume](https://avatars.discourse-cdn.com/v4/letter/k/ecae2f/32.png) [@Kdu\_Bonalume](https://forum.ansible.com/u/Kdu_Bonalume)\
**Post date:** [March 5, 2021, 1:00pm UTC](https://forum.ansible.com/t/variables-requested-via-survey-always-overwrite-template-defaults/34725/1 "2021-03-05T13:00:08Z")

</div>

Hi there,  
I’m running AWX 17.0.1, recently upgraded from 15.x.

Now, suppose you have a template whose default extra\_vars are

```auto
foo: bar
username: "{{ awx_user_name }}"

```

Now consider that this template has a survey to read the user’s input to the **username** variable. The survey doesn’t have a default value, therefore unless the user types in anything, the value returned by the survey will be an empty variable.

It seems that before version 17.x (didn’t test this on 16.x), AWX would preserve the template’s default extra\_vars value but now I see that the empty string gets sent instead.

Could this be considered a bug or is it expected behavior?  
As a workaround, I’m setting a default of “{{ awx\_user\_name }}” to that particular survey.

Thanks in advance for any guidance on this.

Best regards,  
Kdu

---

<div class="post-metadata">

**Author:** ![Alex\_Corey](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@Alex\_Corey](https://forum.ansible.com/u/Alex_Corey)\
**Post date:** [March 5, 2021, 7:13pm UTC](https://forum.ansible.com/t/variables-requested-via-survey-always-overwrite-template-defaults/34725/2 "2021-03-05T19:13:35Z")

</div>

Hey Kdu,

This seems like you’ve found a bug in awx as I would hope that the system would not overwrite a valid string with an empty string. Do you mind filing a but report so that we can investigate further? [https://github.com/ansible/awx/issues/new?assignees=&labels=&template=bug\_report.md](https://github.com/ansible/awx/issues/new?assignees=&labels=&template=bug_report.md)

---

<div class="post-metadata">

**Author:** ![Nicolas\_Salvadore](https://avatars.discourse-cdn.com/v4/letter/n/f14d63/32.png) [@Nicolas\_Salvadore](https://forum.ansible.com/u/Nicolas_Salvadore)\
**Post date:** [March 6, 2021, 11:04pm UTC](https://forum.ansible.com/t/variables-requested-via-survey-always-overwrite-template-defaults/34725/3 "2021-03-06T23:04:55Z")

</div>

Hi there,

Not 100% the same context, but I already reported an issue where an optional survey answer not filled was also passing an empty string value down to the job.  
[https://github.com/ansible/awx/issues/9176#issuecomment-781948806](https://github.com/ansible/awx/issues/9176#issuecomment-781948806)

I guess this may be related though.

Nicolas

---

<div class="post-metadata">

**Author:** ![Kdu\_Bonalume](https://avatars.discourse-cdn.com/v4/letter/k/ecae2f/32.png) [@Kdu\_Bonalume](https://forum.ansible.com/u/Kdu_Bonalume)\
**Post date:** [March 9, 2021, 9:31am UTC](https://forum.ansible.com/t/variables-requested-via-survey-always-overwrite-template-defaults/34725/4 "2021-03-09T09:31:27Z")

</div>

I’ve opened [https://github.com/ansible/awx/issues/9525](https://github.com/ansible/awx/issues/9525) and mentioned Nicolas’ report as well.
