# Enabling Tera \`builtins\` feature

**URL:** <https://zola.discourse.group/t/enabling-tera-builtins-feature/2314>\
**Category:** Support\
**Created:** [October 8, 2024, 10:40am UTC](https://zola.discourse.group/t/enabling-tera-builtins-feature/2314 "2024-10-08T10:40:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BalduinLandolt](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/balduinlandolt/32/1333_2.png) [@BalduinLandolt](https://zola.discourse.group/u/BalduinLandolt)\
**Post date:** [October 8, 2024, 10:40am UTC](https://zola.discourse.group/t/enabling-tera-builtins-feature/2314/1 "2024-10-08T10:40:57Z")

</div>

I’m not sure if I’m just missing something, or if this is not possible at all:

I would like to be able to generate a random number in my template.

In Tera, this seems to be possible, as described [here](https://zola.discourse.group/t/can-i-generate-a-random-number-within-a-range/238/2). (Probably implemented after [this](https://zola.discourse.group/t/can-i-generate-a-random-number-within-a-range/238/2)?)  
But the Tera docs state “Only available if the `builtins` feature is enabled.”  
And when I try to use this, I get an error `Filter 'get_random' not found`.

I’m assuming this means that I somehow need to tell Zola to use Tera with the `builtins` feature enabled. But I do not see how - if at all - I could do this.

---

<div class="post-metadata">

**Author:** ![spence](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/spence/32/1022_2.png) [@spence](https://zola.discourse.group/u/spence)\
**Post date:** [October 20, 2024, 10:32am UTC](https://zola.discourse.group/t/enabling-tera-builtins-feature/2314/2 "2024-10-20T10:32:16Z")

</div>

What version of zola are you using?

`get_random` works for me, for example `{{ get_random(start=0, end=10000000000) }}` printed `8554755875`.

You shouldn’t need to tell Zola to enable `builtins`, so I’m thinking the issue is either a typo or an older version of zola.

---

<div class="post-metadata">

**Author:** ![BalduinLandolt](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/balduinlandolt/32/1333_2.png) [@BalduinLandolt](https://zola.discourse.group/u/BalduinLandolt)\
**Post date:** [November 5, 2024, 6:30pm UTC](https://zola.discourse.group/t/enabling-tera-builtins-feature/2314/3 "2024-11-05T18:30:28Z")

</div>

Sorry for the late response, I somehow missed the notification.

I can’t say for sure what version I was running at the time, but now that I re-checked, this works indeed… I highly suspect it was some kind of error on my side.  
Sorry about this.

However, what I noticed is: It does not generate a new random number when I refresh, only when the page re-builds. (And actually the same for `{{ now() | date(format="%.f") }}` or then I do a HTTP request to an API that returns random values.)  
This effectively renders `get_random` useless for my use case.

Is there any way I can get a new random number each time I re-load the page?

If not, I guess I will have to resort to JavaScript in my template - but I’m afraid this can only turn out messy.

---

<div class="post-metadata">

**Author:** ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)\
**Post date:** [November 5, 2024, 7:14pm UTC](https://zola.discourse.group/t/enabling-tera-builtins-feature/2314/4 "2024-11-05T19:14:17Z")

</div>

> [@BalduinLandolt](#):
>
> However, what I noticed is: It does not generate a new random number when I refresh, only when the page re-builds. (And actually the same for `{{ now() | date(format="%.f") }}` or then I do a HTTP request to an API that returns random values.)  
> This effectively renders `get_random` useless for my use case.
> 
> Is there any way I can get a new random number each time I re-load the page?

The page is only rebuilt if there has been changes, not if you refresh. In the end the output is static HTML file so if you need interactivity it will have to be in JS.
