# Correct syntax for variable default

**URL:** <https://forum.serverless.com/t/correct-syntax-for-variable-default/13807>\
**Category:** Serverless Framework\
**Tags:** variables\
**Created:** [January 20, 2021, 12:13pm UTC](https://forum.serverless.com/t/correct-syntax-for-variable-default/13807 "2021-01-20T12:13:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jesusch](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/jesusch/32/4717_2.png) [@jesusch](https://forum.serverless.com/u/jesusch)\
**Post date:** [January 20, 2021, 12:13pm UTC](https://forum.serverless.com/t/correct-syntax-for-variable-default/13807/1 "2021-01-20T12:13:44Z")

</div>

I’m trying to set a variable from an external yaml file - if that variable dows not exists I want to have a default fallback  
I’ve tried the following syntax which doesn’t seem to work?  
`${file(some_folders/${self:provider.stage}.yml):customDomain, true}`  
any ideas./hints on this syntax?

---

<div class="post-metadata">

**Author:** ![beenmeckel](https://avatars.discourse-cdn.com/v4/letter/b/8dc957/32.png) [@beenmeckel](https://forum.serverless.com/u/beenmeckel)\
**Post date:** [February 13, 2021, 8:25pm UTC](https://forum.serverless.com/t/correct-syntax-for-variable-default/13807/2 "2021-02-13T20:25:03Z")

</div>

I found nothing obviously wrong in that short post, but would have wished for more depth. Also it is funny that the author consistently calls `$_` the default variable. Topic variable is IMHO a much more fitting name. [9Apps](https://9apps.ooo/) [Showbox](https://showbox.kim/) [Tutuapp](https://tutuapp.uno/)
