# Derived Data: set multi-valued property

**URL:** <https://community.bloomreach.com/t/derived-data-set-multi-valued-property/1587>\
**Category:** Experience Manager (PaaS/OnPrem)\
**Created:** [November 20, 2019, 4:24pm UTC](https://community.bloomreach.com/t/derived-data-set-multi-valued-property/1587 "2019-11-20T16:24:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![enzo.lucidi](https://avatars.discourse-cdn.com/v4/letter/e/b4bc9f/32.png) [@enzo.lucidi](https://community.bloomreach.com/u/enzo.lucidi)\
**Post date:** [November 20, 2019, 4:24pm UTC](https://community.bloomreach.com/t/derived-data-set-multi-valued-property/1587/1 "2019-11-20T16:24:54Z")

</div>

Hello,

i’m using a derived data to set some props of my documents, but i’m not able to set **multi-valued property** when this property **is not present before** the derived function runs.

I simply do:  
`parameters.put(ATTR_KEYS, returnedValues);`  
where “ATTR\_KEYS” is the name of the prop and “returnedValues” is an array of Value objects.

If the prop is already present, it’s work, but when not present, the derived function try to create it but with **single-valued** , and store only the first element of the array.

How can i fix it?  
Enzo

---

<div class="post-metadata">

**Author:** ![jeroen.hoffman](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/jeroen.hoffman/32/43_2.png) [@jeroen.hoffman](https://community.bloomreach.com/u/jeroen.hoffman)\
**Post date:** [November 21, 2019, 8:50am UTC](https://community.bloomreach.com/t/derived-data-set-multi-valued-property/1587/2 "2019-11-21T08:50:42Z")

</div>

Hi Enzo,

I see that the code behind this only adds a multiple property if there’s a property definition saying it’s a multiple. This is on CND level so kind of an outdated approach. There’s room for improvement I’d say… you’re welcome to create an issue at [https://issues.onehippo.com/projects/CMS](https://issues.onehippo.com/projects/CMS).

For you now, you should be able to work around it by making sure the documents do have the property already. Think Groovy script initially, adding it to the document’s prototype for new documents.

HTH  
Jeroen

---

<div class="post-metadata">

**Author:** ![enzo.lucidi](https://avatars.discourse-cdn.com/v4/letter/e/b4bc9f/32.png) [@enzo.lucidi](https://community.bloomreach.com/u/enzo.lucidi)\
**Post date:** [November 21, 2019, 9:17am UTC](https://community.bloomreach.com/t/derived-data-set-multi-valued-property/1587/3 "2019-11-21T09:17:26Z")

</div>

Thanks jeroen,

yes, i used a groovy script to create that multi-values prop as a workaround, and added the initial state in the prototype node of its document type.  
I also created this issue as you suggest: [https://issues.onehippo.com/browse/CMS-12378](https://issues.onehippo.com/browse/CMS-12378)

Enzo

---

<div class="post-metadata">

**Author:** ![jeroen.hoffman](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/jeroen.hoffman/32/43_2.png) [@jeroen.hoffman](https://community.bloomreach.com/u/jeroen.hoffman)\
**Post date:** [November 21, 2019, 9:56am UTC](https://community.bloomreach.com/t/derived-data-set-multi-valued-property/1587/4 "2019-11-21T09:56:42Z")

</div>

Glad you have it working.  
Thanks Enzo!
