# Creating/changing of variable programmatically

**URL:** <https://community.integray.com/t/creating-changing-of-variable-programmatically/219>\
**Category:** Platform discussions\
**Created:** [November 13, 2023, 11:57am UTC](https://community.integray.com/t/creating-changing-of-variable-programmatically/219 "2023-11-13T11:57:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michal](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@Michal](https://community.integray.com/u/Michal)\
**Post date:** [November 13, 2023, 11:57am UTC](https://community.integray.com/t/creating-changing-of-variable-programmatically/219/1 "2023-11-13T11:57:17Z")

</div>

Hi there 👋!

I have a simple REST API task step returning bearer token. It would be great to store it and use it for further communication between Integray and my other app.

The question is if there is any simple way how to store received token within variables?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![libor.zoubek](https://avatars.discourse-cdn.com/v4/letter/l/58f4c7/32.png) [@libor.zoubek](https://community.integray.com/u/libor.zoubek)\
**Post date:** [November 13, 2023, 2:07pm UTC](https://community.integray.com/t/creating-changing-of-variable-programmatically/219/2 "2023-11-13T14:07:50Z")

</div>

Hello Michal,

I am afraid you cannot create/update variable programmatically. Variables belong to configuration (together with your tasks, endpoints etc) and tasks should not modify it.

Are you sure you want to persist token? Tokens have lifetime and may (will) expire.

---

<div class="post-metadata">

**Author:** ![Michal](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@Michal](https://community.integray.com/u/Michal)\
**Post date:** [November 13, 2023, 2:14pm UTC](https://community.integray.com/t/creating-changing-of-variable-programmatically/219/3 "2023-11-13T14:14:56Z")

</div>

This one has no expiration date. However, I will store the token somewhere else.

Thanks anyway!

---

<div class="post-metadata">

**Author:** ![tomas](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@tomas](https://community.integray.com/u/tomas)\
**Post date:** [November 16, 2023, 7:56am UTC](https://community.integray.com/t/creating-changing-of-variable-programmatically/219/4 "2023-11-16T07:56:41Z")

</div>

Hi Michal and Libor,

current we can 't change variables outside the Integray even if we have remoteAPI available. The reason is that variables are replaced during configuration Publish. We are currently working on multiple features that would make this available via RemoteAPI but we have to first sort out partial cache rebuild as our first priority is performance.

Tomas.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.integray.com/u/system)\
**Post date:** [November 23, 2023, 7:57am UTC](https://community.integray.com/t/creating-changing-of-variable-programmatically/219/5 "2023-11-23T07:57:27Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
