Reset default values in a document

I have the code below. The aim is to show a default input text, with the possibility to overwrite it.

Different people will use this document.

If a first person changes the text, the second user won’t see the default text (unless the input text is deleted).

I might have several of such input fields with a default input. All of these fields might be changed so the document that is seen by for instance a third user, might be quite different from the default one.

I suppose there is no way to reset a document to all of its default values?

{% capture default %}Dit is de standaardtekst{% endcapture %}

{% ic %}
{% input company.custom.omschrijving.algemeen as:text default:default %}
{% endic %}

{% capture output %}{% if company.custom.omschrijving.algemeen == empty %}{{default}}{% else %}{{company.custom.omschrijving.algemeen}}{% endif %}{% endcapture %}

{{output}}

Hi @Warde,

Well, good question though :blush:

If you delete the value of that input, you’ll see the default value and the input is actually reset, no?
Also, when a default changes, you’ll see that too (below is a screenshot of our Silverfin changelog):

But you’ll probably want to see the default, even if the input is changed from the default?
Then you could use what you coded and display the default in an infotext as hover perhaps?

Hope this clarifies it a bit for you?

Hi, tx Sven.

The question is rather about resetting let’s say for instance 10 or 20 input fields all at once to there default values.
It is indeed possible to do this one by one by deleting the input text, but it would be easier to have it done in one action. The latter would also guarantee that one can start with a “clean” document with all of its default values. Doing it one by one does not only takes more time, there is also a higher risk of skipping one of the fields.
But based on your answer, I understand there is no such way to do it all at once.

Ward

I’m afraid not @Warde, unless you create a boolean on top of your document. When checked, you show the default (with no option to overwrite), otherwise you just show the inputs with the actual values.

That could be something, but not a big fan of working like that, as the boolean will hide values that are actually stored in the database.
But it maybe gives you an idea?

I was thinking you could use the rollforward function perhaps too, but that’s just from one period to another.
More info here:

But imo, that too is not a good workaround, as it is not meant for that and you want to reset values within one period.

If you’re still stuck on this, please, let us known so we can find something together.