AEM Metadata Schema Dynamic Dropdown

Avatar

Avatar

DhirajAg

Avatar

DhirajAg

DhirajAg

16-04-2019

I have a dropdown field in the metadata schema editor and I want the options of this dropdown to be populated dynamically from a servlet response. I am following below guide to achieve it. There is a question around my requirement and from the author's answer it seems just pointing the JSON path to the servlet should help achieve it. Has anybody come across this before? Do you know if it works coz I have not been able to achieve it. If i point the JSON path to an nt:file it works.

Using a JSON file with the Dropdown widget on the Metadata Schema | Content Management

Options array from the servlet or in the JSON file

{

"options": [

{

"value": "en-gb",

"text": "English-United Kingdom"

},

{

"value": "en-us",

"text": "English-United States"

},

{

"value": "fr-ca",

"text": "French-Canada"

},

{

"value": "fr-fr",

"text": "French-France"

},

{

"value": "de-de",

"text": "German-Germany"

},

{

"value": "es-mx",

"text": "Spanish-Mexico"

},

{

"value": "es-es",

"text": "Spanish-Spain"

}

]

}

JSON path value - /etc/tags/custom/industries.options.json

Replies

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K
smacdonald2008

16-04-2019

You can populate a GRANITE Select with a Sling Servlet. Is this dropdown a Granite Select field?

Avatar

Avatar

DhirajAg

Avatar

DhirajAg

DhirajAg

16-04-2019

It's in the asset metadata schema not in a component.

Avatar

Avatar

sarahm89689524

Avatar

sarahm89689524

sarahm89689524

26-06-2019

Not sure if this is what you're talking about but it could be in a Show/Hide that's in the standard library. Here's a video on this FWIW.

D