# How to set a Map as Value for InputParameter using BPMN Moddle

**URL:** <https://forum.bpmn.io/t/how-to-set-a-map-as-value-for-inputparameter-using-bpmn-moddle/7955>\
**Category:** Modeler\
**Created:** [September 5, 2022, 8:20pm UTC](https://forum.bpmn.io/t/how-to-set-a-map-as-value-for-inputparameter-using-bpmn-moddle/7955 "2022-09-05T20:20:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![segura27](https://forum.bpmn.io/user_avatar/forum.bpmn.io/segura27/32/3853_2.png) [@segura27](https://forum.bpmn.io/u/segura27)\
**Post date:** [September 5, 2022, 8:20pm UTC](https://forum.bpmn.io/t/how-to-set-a-map-as-value-for-inputparameter-using-bpmn-moddle/7955/1 "2022-09-05T20:20:56Z")

</div>

Hi Phillip,

That worked, I appreciate your help.

Thank you again,  
Daniel S.

---

<div class="post-metadata">

**Author:** ![philippfromme](https://forum.bpmn.io/user_avatar/forum.bpmn.io/philippfromme/32/2803_2.png) [@philippfromme](https://forum.bpmn.io/u/philippfromme)\
**Post date:** [September 6, 2022, 9:57am UTC](https://forum.bpmn.io/t/how-to-set-a-map-as-value-for-inputparameter-using-bpmn-moddle/7955/2 "2022-09-06T09:57:39Z")

</div>

You create an input parameter with a map as follows:

```javascript
const entry = moddle.create("camunda:Entry", { key: "foo", value: "bar" });

const map = moddle.create("camunda:Map", { entries: [entry] });

entry.$parent = map;

const inputParameter = moddle.create("camunda:InputParameter", {
  definition: map
});

map.$parent = inputParameter;

```

Full example: [Camunda Map Example - CodeSandbox](https://codesandbox.io/s/camunda-map-example-1jzre0)

---

<div class="post-metadata">

**Author:** ![segura27](https://forum.bpmn.io/user_avatar/forum.bpmn.io/segura27/32/3853_2.png) [@segura27](https://forum.bpmn.io/u/segura27)\
**Post date:** [September 7, 2022, 7:55pm UTC](https://forum.bpmn.io/t/how-to-set-a-map-as-value-for-inputparameter-using-bpmn-moddle/7955/3 "2022-09-07T19:55:22Z")

</div>

I do have a follow up question, though.

Your solution works great. How can I access the entry’s value by key on my backend?

I’m using Java/Kotlin:

```auto
    import org.camunda.bpm.engine.externaltask.LockedExternalTask

    //... irrelevant code

    val nodeInput = lockedExternalTask.variables.getValue(RunJobConstants.NODE_INPUT) as String
   

```

I was doing this to get my value from a string, but now, that string is wrapped in a map and an entry.

By the way, where can I find the API reference or somewhere I can check this on my own? I’m having a hard time locating stuff.

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![Niklas\_Kiefer](https://forum.bpmn.io/user_avatar/forum.bpmn.io/niklas_kiefer/32/3882_2.png) [@Niklas\_Kiefer](https://forum.bpmn.io/u/Niklas_Kiefer)\
**Post date:** [September 8, 2022, 7:29am UTC](https://forum.bpmn.io/t/how-to-set-a-map-as-value-for-inputparameter-using-bpmn-moddle/7955/4 "2022-09-08T07:29:59Z")

</div>

It looks like your question is not related to [our project](https://bpmn.io/) or one of our toolkits. For questions regarding other tools please refer to their respective communication channels. If your question is about the [Camunda platform](https://github.com/camunda) or the Camunda Modeler, please head over to the [Camunda forum](https://forum.camunda.io/c/modeler) for assistance.

Please provide more context if you are certain this is the right place to get an answer and we may be able to help you.

Thank you ☀

---

<div class="post-metadata">

**Author:** ![system](https://forum.bpmn.io/uploads/default/original/2X/b/b534893973385c2d302b38572464112e4adae002.png) [@system](https://forum.bpmn.io/u/system)\
**Post date:** [September 15, 2022, 7:30am UTC](https://forum.bpmn.io/t/how-to-set-a-map-as-value-for-inputparameter-using-bpmn-moddle/7955/5 "2022-09-15T07:30:44Z")

</div>

Closed on September 15, 2022, 7:30am UTC

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