# How to use custom variables in Grafana?

**URL:** <https://community.grafana.com/t/how-to-use-custom-variables-in-grafana/45374>\
**Category:** Grafana\
**Tags:** api\
**Created:** [March 31, 2021, 5:41am UTC](https://community.grafana.com/t/how-to-use-custom-variables-in-grafana/45374 "2021-03-31T05:41:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lee](https://avatars.discourse-cdn.com/v4/letter/l/bc8723/32.png) [@lee](https://community.grafana.com/u/lee)\
**Post date:** [March 31, 2021, 5:41am UTC](https://community.grafana.com/t/how-to-use-custom-variables-in-grafana/45374/1 "2021-03-31T05:41:50Z")

</div>

Hi,  
I have a variable which is the number variable, I want to build a custom variable. It can take a modulo operation on that number variable. How can I do it?

Such as the id variable is 1091521, I want use the id to take a modulo operation to get the constant variable.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/grafana/original/2X/e/ef5308cc58c9e5a13187b5012eb99f406928462f.png) [@system](https://community.grafana.com/u/system)\
**Post date:** [March 31, 2022, 5:41am UTC](https://community.grafana.com/t/how-to-use-custom-variables-in-grafana/45374/2 "2022-03-31T05:41:59Z")

</div>

This topic was automatically closed after 365 days. New replies are no longer allowed.
