# How to define default value

**URL:** <https://forum.dimagi.com/t/how-to-define-default-value/4804>\
**Category:** Users\
**Created:** [December 15, 2017, 5:11am UTC](https://forum.dimagi.com/t/how-to-define-default-value/4804 "2017-12-15T05:11:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tewelde\_Aregawi](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/t/8c91f0/32.png) [@Tewelde\_Aregawi](https://forum.dimagi.com/u/Tewelde_Aregawi)\
**Post date:** [December 15, 2017, 5:11am UTC](https://forum.dimagi.com/t/how-to-define-default-value/4804/1 "2017-12-15T05:11:57Z")

</div>

I have facility assessment form and there is question asking called Facility number. I need this value to be default zero and increasing by 1 when the questionnaire filled

---

<div class="post-metadata">

**Author:** ![Kaley\_Lambden](https://dimagi.b-cdn.net/user_avatar/forum.dimagi.com/kaley_lambden/32/490_2.png) [@Kaley\_Lambden](https://forum.dimagi.com/u/Kaley_Lambden)\
**Post date:** [December 15, 2017, 4:52pm UTC](https://forum.dimagi.com/t/how-to-define-default-value/4804/2 "2017-12-15T16:52:08Z")

</div>

Hi Tewelde,

You can use the [coalesce](https://confluence.dimagi.com/display/commcarepublic/CommCare+Functions#CommCareFunctions-coalesce) function to [add a counter](https://confluence.dimagi.com/display/commcarepublic/Incrementing+a+counter) to your form. For example, if your question ID is facility\_number (and has been saved as a case property), this function would look like:

coalesce(#case/facility\_number, 0) + 1

Hope this helps!

Cheers,  
Kaley

---

<div class="post-metadata">

**Author:** ![Tewelde\_Aregawi](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/t/8c91f0/32.png) [@Tewelde\_Aregawi](https://forum.dimagi.com/u/Tewelde_Aregawi)\
**Post date:** [December 16, 2017, 7:03am UTC](https://forum.dimagi.com/t/how-to-define-default-value/4804/3 "2017-12-16T07:03:00Z")

</div>

Hi Kaley

Thanks for the quick reply.As this is one times survey i can't save facility\_number as case property. Can i?

---

<div class="post-metadata">

**Author:** ![Kaley\_Lambden](https://dimagi.b-cdn.net/user_avatar/forum.dimagi.com/kaley_lambden/32/490_2.png) [@Kaley\_Lambden](https://forum.dimagi.com/u/Kaley_Lambden)\
**Post date:** [December 18, 2017, 6:41pm UTC](https://forum.dimagi.com/t/how-to-define-default-value/4804/4 "2017-12-18T18:41:30Z")

</div>

Hi Tewelde,

You are correct that if you are using a one-time Survey form you can't save facility\_number as a case property and the function I shared won't work. However if you are trying to determine how many times the survey form has been filled out in total, could you [export the form data](https://confluence.dimagi.com/display/commcarepublic/Form+Data+Export) and from that data determine how many times the form has been filled out?
