# Use dynamic keys in context

**URL:** <https://forum.camunda.io/t/use-dynamic-keys-in-context/61694>\
**Category:** Discussion & Questions\
**Tags:** process-engine, modeler, camunda-8\
**Created:** [May 5, 2025, 10:57am UTC](https://forum.camunda.io/t/use-dynamic-keys-in-context/61694 "2025-05-05T10:57:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vorbrom](https://forum.camunda.io/letter_avatar_proxy/v4/letter/v/73ab20/32.png) [@vorbrom](https://forum.camunda.io/u/vorbrom)\
**Post date:** [May 5, 2025, 10:57am UTC](https://forum.camunda.io/t/use-dynamic-keys-in-context/61694/1 "2025-05-05T10:57:35Z")

</div>

Hello!

I’m trying to use dynamic keys in my context but it seems like whatever I do it just tries to make a string of whatever I put as the key.

Here is a simplification of what I am trying to do. I have the variable “myId”:“123456789”, and then I’m trying to create a context using this, like so:

{myId: “here is a string relating to the id”}

What I would expect is:  
{“123456789”: “here is a string relating to the id”}

But what actually happens is:  
{“myId”: “here is a string relating to the id”}

Is dynamic keys simply not possible using FEEL expression, or is there a way to make this work? I’m not able to find any solution in the documentation or in the forum on this.

Thank you for your time!

---

<div class="post-metadata">

**Author:** ![nathan.loding](https://forum.camunda.io/user_avatar/forum.camunda.io/nathan.loding/32/24171_2.png) [@nathan.loding](https://forum.camunda.io/u/nathan.loding)\
**Post date:** [May 5, 2025, 8:33pm UTC](https://forum.camunda.io/t/use-dynamic-keys-in-context/61694/2 "2025-05-05T20:33:37Z")

</div>

Hi @vorbrom - you want to use the [`context put` function](https://docs.camunda.io/docs/components/modeler/feel/builtin-functions/feel-built-in-functions-context/#context-putcontext-key-value). To access an entry in a context with a variable, you would use the [`get value`](https://docs.camunda.io/docs/components/modeler/feel/builtin-functions/feel-built-in-functions-context/#get-valuecontext-key) function.

[Here’s a demo in the FEEL playground](https://camunda.github.io/feel-scala/docs/playground/?expression=Y29udGV4dCBwdXQoY3R4LCBteUlkLCAidmFsdWUyIik%3D&context=ewogICJjdHgiOiB7ICJzdGF0aWNJZCI6ICJ2YWx1ZTEiIH0sCiAgIm15SWQiOiAiZHluYW1pY0lkIgp9&expression-type=expression).

 ![image](https://forum.camunda.io/uploads/default/original/3X/d/f/dfd308fe1c24f119fe5ef4a2919c893b299b13e8.png)
