AI OnAI Off
Hi,
It will not show for your custom properties you need to create filter and serialize it. By default, opti doesn't do that for custom properties.
I didn't do that form but I did for pages -> content area items, here you can find an example.
https://world.optimizely.com/blogs/puneetgarg/dates/2024/10/headless-with-content-delivery-api/
I have a custom form element and have a headless form setup. When I get the form details via the API, the custom field doesn't render some property.
Here how the setup:
I follow setting up the headless form by the steps on this page `https://docs.developers.optimizely.com/content-management-system/v1.2.0-forms/docs/set-up-headless-optimizely-forms-api
In the CMS I create a DEMO form and added some fundamental form element similar to the screenshot here:
On the Postman, I call the API to get the form details https://localhost:5000/_forms/v1/forms/2ECB95DA05964DF9B5108A5318359E58?locale=en, this is the JSON I got. Please notice that each `formElements` render the "properties.items" as it set within the CMS.
Then I implement a custom form element like this. The custom element is simple to show the POC if the issue.
I can then put the new custom element on the form like this:
And setup the choice of that field to the similar screenshot below:
But when I call the same form API again, the JSON that return looks like this
The issue is, in the custom element, "CheckboxElementBlock", it doesn't contains the "properties.items". Even it inherits from the class `SelectionElementBlockBase<OptionItem>`.
Could anyone help me to find out if I missed anything in this implementation, or is there any workaround to make the custom element renders the `properties.items` in the form API?