Fetching dropdown fields values using jcr:sql2 query | Community
Skip to main content
Nitin_laad
Community Advisor
Community Advisor
August 7, 2020
Question

Fetching dropdown fields values using jcr:sql2 query

  • August 7, 2020
  • 2 replies
  • 920 views

Hi, 

I have a requirement to fetch all the dropdown fields along with associated values from metadata schema in below format

Dropdown Name                     Option text                  Option Value
Citi
                                               New York                     ny

                                                Boston                       boston

Gender 
                                              Male                               M
                                              Female                          F

I am able to get list of available dropdown fields using below query, but facing difficulty in building nested query to get associated text and values. 


SELECT * FROM [nt:base] AS s WHERE ISDESCENDANTNODE([/conf/global/settings/dam/adminui-extension/metadataschema/sampleschema]) AND resourceType= 'dam/gui/coral/components/admin/schemaforms/formbuilder/formfields/v2/metadataselect'

 

 

Can you please share your thoughts/suggestion to solve this ?

 

Thanks, 

Nj

 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

kaikubad
Community Advisor
Community Advisor
November 23, 2024

Please try this query.

 

SELECT * FROM [nt:base]
WHERE ISDESCENDANTNODE([/conf/global/settings/dam/adminui-extension/metadataschema])
AND [jcr:primaryType] = 'nt:unstructured'
AND [sling:resourceType] = 'dam/gui/components/admin/schemafield'

kautuk_sahni
Community Manager
Community Manager
April 1, 2025

@nitin_laad Did you find the suggestion helpful? Please let us know if you need more information. If a response worked, kindly mark it as correct for posterity; alternatively, if you found a solution yourself, we’d appreciate it if you could share it with the community. Thank you!

Kautuk Sahni