# How to create a dependent string field

**URL:** <https://community.bloomreach.com/t/how-to-create-a-dependent-string-field/312>\
**Category:** Experience Manager (PaaS/OnPrem)\
**Created:** [August 23, 2018, 5:01pm UTC](https://community.bloomreach.com/t/how-to-create-a-dependent-string-field/312 "2018-08-23T17:01:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rakesh](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@rakesh](https://community.bloomreach.com/u/rakesh)\
**Post date:** [August 23, 2018, 5:01pm UTC](https://community.bloomreach.com/t/how-to-create-a-dependent-string-field/312/1 "2018-08-23T17:01:14Z")

</div>

Hi,

How can I create a dependent string field which observes the value of a compound field(Having dropdown fields).

For example, if in the compound field the values are selected as News,Politics I want the string to have its value as News,Politics.

I know that there is observer and observable id for dynamic dropdown but I needed something like this for the string.

Is there any out of the box functionality in Hippo that I can configure? If not is there a way to develop this functionality? Any thoughts?

Thanks,  
RK

---

<div class="post-metadata">

**Author:** ![woonsanko](https://avatars.discourse-cdn.com/v4/letter/w/b5a626/32.png) [@woonsanko](https://community.bloomreach.com/u/woonsanko)\
**Post date:** [August 24, 2018, 3:00pm UTC](https://community.bloomreach.com/t/how-to-create-a-dependent-string-field/312/2 "2018-08-24T15:00:07Z")

</div>

> [@rakesh](#):
>
> How can I create a dependent string field which observes the value of a compound field(Having dropdown fields).
> 
> For example, if in the compound field the values are selected as News,Politics I want the string to have its value as News,Politics.
> 
> I know that there is observer and observable id for dynamic dropdown but I needed something like this for the string.
> 
> Is there any out of the box functionality in Hippo that I can configure? If not is there a way to develop this functionality? Any thoughts?

I don’t think there’s a super-easy way. But you might want to try a client-side solution like this:

- William demonstrated how to create a custom head contribution plugin (which could be added to a document type namespace editor:template definition) to add your custom javascript library. [1]
- You can set custom CSS class names for a field in the document type editor.
- Your custom Javascript can possibly do some magic. e.g, add onchange event handler to HTML elements having a specific CSS class to read those and update another HTML element having another specific CSS class.

Yeah, it’s not clean. I have no other idea.

Woonsan

[1] [Redirecting to Google Groups](https://groups.google.com/forum/#!topic/hippo-community/gvyNP132ZT0)

---

<div class="post-metadata">

**Author:** ![rakesh](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@rakesh](https://community.bloomreach.com/u/rakesh)\
**Post date:** [August 24, 2018, 3:47pm UTC](https://community.bloomreach.com/t/how-to-create-a-dependent-string-field/312/3 "2018-08-24T15:47:58Z")

</div>

Thanks for the response Woonsan. Will give a try.
