Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

[AEM Gems Webinar] Accelerating Experience Manager as a Cloud Service development with Rapid Development Environments
Adobe Summit 2023 | Complete list of AEM Sessions & Labs
SOLVED

Datasource in Form Options Dropdown

Avatar

Level 5

Hi all, 

I am new to AEM forms, I want to create a registration form where I need to get states from the dropdown using Datasource. Can anyone help me how to do this with datasource so that dropdown values pushed automatically on the page ??

 

VanithaB1_0-1647935052565.png

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Got it. You will have to create a granite datasource for this. I'll link below on how to create a granite datasource. Create a slingServlet registered with resourceType. This resourceType should be given in the 'Datasource' field in the forms dialog. In the sling servlet, you can add a DataSource object and push in the states values here.

 

https://redquark.org/aem/day-17-granite-datasources/

 

 

View solution in original post

3 Replies

Avatar

Community Advisor

Hi @Tessa_learner1 

 

If my understanding is correct, you want list of states in a dropdown using datasource. There are lot of solutions for this and i'm gonna link them below.

https://levelup.gitconnected.com/aem-populate-a-drop-down-with-a-data-source-edafada90cc4

 

ACS commons solution using generic list: https://www.youtube.com/watch?v=Mi35V3cdmBo

 

Thanks

Avatar

Level 5

Hello @JeevanRaj  Yes, I want a states dropdown using datasource. Actually I have tried this with custom component it's working. But I just want to do with AEM form options(core form container) since I'm creating Registration form. So I don't know how to create this datasource in form options. Can you guide me ??

Avatar

Correct answer by
Community Advisor

Got it. You will have to create a granite datasource for this. I'll link below on how to create a granite datasource. Create a slingServlet registered with resourceType. This resourceType should be given in the 'Datasource' field in the forms dialog. In the sling servlet, you can add a DataSource object and push in the states values here.

 

https://redquark.org/aem/day-17-granite-datasources/