AEM Forms Forum

Q: Populating drop-down lists with data from a Form Data Model

I have 2 dynamic drop-down lists on an adaptive form. The data sources for both are from an FDM (Form Data Model) and the get service for both return multiple elements in an array. One of the drop-down lists works and the other does not. I cannot figure it out. Can you help me with this?

erik.broberg@hennepin.us, 2022-04-28 17:01:27

jp@smartdoctech.comcommented:April 28th, 2022

Hi Erik, Can you show me where this adaptive form is on the SmartDoc Sandbox? Is it in your personal folder in the Hennepin folder? If so, I can take a look. Thanks.

anonymouscommented:April 28th, 2022

Here is the code for each dropdown list: This one Works: var operationInfo = { "formDataModelId": "/content/dam/formsanddocuments-fdm/public_works/PW_granttracking", "operationTitle": "getGrantlkp", "operationName": "getGrantlkp" }; var inputs = { "GRANT_YEAR" : this }; var outputs={ savedValue:'GRANTID', displayedValue:'GRANT_NAME', field:guideRootPanel.Search.dropdownlist1650315040771 }; guidelib.dataIntegrationUtils.setOptionsFromService(operationInfo, inputs, outputs); This one does not: var operationInfo = { "formDataModelId": "/content/dam/formsanddocuments-fdm/public_works/PW_granttracking", "operationTitle": "getGrantDetailTypeLKP", "operationName": "getGrantDetailTypeLKP" }; var inputs = { }; var outputs={ savedValue:'GRANT_DETAIL', displayedValue:'GRANT_DETAIL', field:this }; guidelib.dataIntegrationUtils.setOptionsFromService(operationInfo, inputs, outputs);

erik.broberg@hennepin.uscommented:April 29th, 2022

I do not have the form in the smartdoc sandbox. It is in our Dev portal. I could do a remote session with you via teams meeting.

Reply

Attach a screenshot or PDF file (optional)


Welcome...

The AEM Forms Forum is designed to help you post questions about AEM Forms and benefit from the questions and answers posted by your colleagues. You can access detailed documentation and courseware about the topics in your question with your SmartDoc Subscription.

Adaptive Forms