adobe / adobe/aem-core-forms-components
Request for Information: How to Retrieve a Component’s Value in AEM Core Forms
- Dominant language
- JavaScript
- Stars
- 36
- Forks
- 62
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 8
Description
We're currently migrating from AEM Foundation Forms Components to AEM Core Forms Components. We have a custom “Label Value” component that needs to retrieve values from other components. In Foundation Forms, we accessed these values using guidelib.__runtime__[fieldName], but now we want an equivalent approach in AEM Core Forms.
After exploring guideBridge, we did find a working solution, but it’s difficult to maintain. For example, we already know the field name, we search for it by navigating through:
`window.guideBridge?.getFormModel?.().items[0].items[0].items[0]._jsonModel.name`
If that matches, we then retrieve the value from:
`window.guideBridge?.getFormModel?.().items[0].items[0].items[0]._jsonModel.value`
We have multiple panels (some are repeatable), so we need to check if the panel name matches what the author entered, locate the correct panel array index, and then match the field name to ultimately get something like:
`window.guideBridge?.getFormModel?.().items[0].items[1].items[3]._jsonModel.value`
Doing all of this is not easy, and we plan to add more functionality—like setting an optionbindref for pre-fill and updating values when users select certain options.
Because of these complexities, we’d like to know if there’s any out-of-the-box functionality, or at least a simpler pattern or API, for reliably retrieving and modifying these values without manually navigating through the window.guideBridge?.getFormModel? structure.
Contributor guide
Research direction
Start with the guideBridge.getFormModel entry point and the issue's examples using _jsonModel.name and _jsonModel.value. Determine whether AEM Core Forms provides a supported API or documented pattern for locating, retrieving, and modifying values across panels and repeatable panels; done means identifying that API or documenting its absence and limitations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api, frontend
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100