# CASE: when to use placeholder or default?

**URL:** <https://community.silverfin.com/t/case-when-to-use-placeholder-or-default/467>\
**Category:** Cases\
**Tags:** default, placeholder\
**Created:** [November 7, 2017, 3:53pm UTC](https://community.silverfin.com/t/case-when-to-use-placeholder-or-default/467 "2017-11-07T15:53:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sven](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/sven/32/1495_2.png) [@sven](https://community.silverfin.com/u/sven)\
**Post date:** [November 7, 2017, 3:53pm UTC](https://community.silverfin.com/t/case-when-to-use-placeholder-or-default/467/1 "2017-11-07T15:53:28Z")

</div>

When you create a custom object, you’ll have the option to add the following tags:

**placeholder**

```auto
{% input custom.the_namespace.the_key placeholder:"enter name here" %}

```

This guides the user what to do with the object (to fill it with a name):  
 ![45](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/1X/cb04913ebf5735a4aacc271191b9e1f77ed3a235.png)

The “enter name here” will never be displayed too in an export. So if you don’t fill a value in the object, nothing will be displayed in the export. You could say the placeholder-tag has only use for input-mode.

**default**

```auto
{% input custom.the_namespace.the_key default:"Michael Jordan" %}

```

This tag is meant for the output-mode. In input-mode the value will also be displayed (so the user doesn’t have to fill it in), but in export that value will also be shown:

_input_

![46](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/1X/19b1755c9e496feaeb5f718380bfcf60b38d82f7.png)

_output_

![30](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/1X/164e3bd596bf4febdc8ca77740bd083614e8a1a5.png)

⚠ Beware though! A default-tag never will fill the object with the default. So in this example the object custom.the\_namespace.the\_key is empty! But, in export it will show something. Very important to understand this matter  
The reason for this, is that an input is only made possible by Silverfin; in standard Liquid (Shopify made this) this isn’t even possible. Only when you actually put something in the object, the object will no longer be empty (and a default-tag doesn’t fill the object at all!) ⚠

If any questions, plz shoot

---

<div class="post-metadata">

**Author:** ![EHE1](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/ehe1/32/2002_2.png) [@EHE1](https://community.silverfin.com/u/EHE1)\
**Post date:** [June 5, 2023, 2:24pm UTC](https://community.silverfin.com/t/case-when-to-use-placeholder-or-default/467/2 "2023-06-05T14:24:07Z")

</div>

How can you use the value of the default in an other object?

exemple:

> op datum van {% input period.custom.letter.date as:date default:period.custom.av.datum %}
> 
> Gedaan te {% input.custom.opdrachtbrief.gemeente %} op {{ period.custom.letter.date }}

---

<div class="post-metadata">

**Author:** ![Romy\_Vermeeren](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/romy_vermeeren/32/2295_2.png) [@Romy\_Vermeeren](https://community.silverfin.com/u/Romy_Vermeeren)\
**Post date:** [June 6, 2023, 6:45am UTC](https://community.silverfin.com/t/case-when-to-use-placeholder-or-default/467/3 "2023-06-06T06:45:16Z")

</div>

Hi @EHE1

“default” can also be used when printing or creating new variables, so not only on inputs.  
In this example you can create a new local variable that holds the input and the default.

```auto
{% assign letter_date = period.custom.letter.date | default:period.custom.av.datum %}
Gedaan te {% input.custom.opdrachtbrief.gemeente %} op {{ letter_date }}

```

Alternatively, this would also work:

```auto
Gedaan te {% input.custom.opdrachtbrief.gemeente %} op {{ period.custom.letter.date | default:period.custom.av.datum }}

```

Though I recommend using the first approach with the local variable.

Kind regards,  
Romy

---

<div class="post-metadata">

**Author:** ![Jasper](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/jasper/32/2189_2.png) [@Jasper](https://community.silverfin.com/u/Jasper)\
**Post date:** [October 6, 2023, 11:54am UTC](https://community.silverfin.com/t/case-when-to-use-placeholder-or-default/467/4 "2023-10-06T11:54:57Z")

</div>

Hey,

This doesn’t seem to be working. We have the following custom input in the configuration for the witholding\_tax template. But it doesn’t print anything in the export.

`{% input period.custom.contact.name as:text default:user.name assign:contact_name %}`

---

<div class="post-metadata">

**Author:** ![Robbe\_Dewilde](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/robbe_dewilde/32/1634_2.png) [@Robbe\_Dewilde](https://community.silverfin.com/u/Robbe_Dewilde)\
**Post date:** [October 9, 2023, 7:13am UTC](https://community.silverfin.com/t/case-when-to-use-placeholder-or-default/467/5 "2023-10-09T07:13:55Z")

</div>

Hi Jasper

This is related to [this question](https://community.silverfin.com/t/use-of-the-user-method-in-export-styles/2442) a from a while back.

The default name is not being displayed in export, because the user drop can’t be accessed in the export styles.

Kind regards  
Robbe

---

<div class="post-metadata">

**Author:** ![Jasper](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/jasper/32/2189_2.png) [@Jasper](https://community.silverfin.com/u/Jasper)\
**Post date:** [October 9, 2023, 12:01pm UTC](https://community.silverfin.com/t/case-when-to-use-placeholder-or-default/467/6 "2023-10-09T12:01:19Z")

</div>

Hi Robbe,

Ok, I get it now.  
I have added an if-statement to print the ‘result’ when the default is used.  
This did the trick for the export.

Is there a list of drops that cannot be accessed in the export styles?  
I didn’t seem to find somthing like it in the STL documentation.

Thank you again for the feedback.

Kind regards  
Jasper
