web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Unanswered

In ecommerce module config JSON, can a definition also have dependent config options?

(0) ShareShare
ReportReport
Posted on by

I have created a custom module for a kind of form builder. It is configured with an array of fields pointing to a definition in the config file. Within the definition of the objects, I'd like to only show the options config when the inputType matches certain values. Config like the example below following builds, runs, and works successfully with mock data, but on deployment the dependent config option doesn't show. I tried putting the dependent schema inside the definition, but that didn't build. Is what I'm trying to do possible?

    "config": {
        "heading": {
            "friendlyName": "Heading",
            "description": "Module heading",
            "$ref": "@msdyn365-commerce-modules/definitions/dist/src/Heading.json#/definitions/heading"
        },
        "fields": {
            "type": "array",
            "friendlyName": "Form fields",
            "description": "Form fields to show",
            "items": {
                "$ref": "#/definitions/formField"
            }
        }
    },
    "definitions": {
        "formField": {
            "type": "object",
            "friendlyName": "Form field",
            "description": "HTML form field",
            "properties": {
                "name": {
                    "type": "string",
                    "friendlyName": "Name",
                    "description": "Name of the input",
                    "required": true
                },
                "inputType": {
                    "type": "string",
                    "friendlyName": "Type of control",
                    "description": "HTML input type to render",
                    "enum": {
                        "text": "Text box",
                        "textarea": "Text area",
                        "select": "Dropdown list",
                        "radio": "Radio button list",
                        "checkbox": "Checkbox"
                    },
                    "default": "text",
                    "required": true
                }
            }
        }
    },
    "dependentSchemas": {
        "inputType": {
            "oneOf": [
                {
                    "properties": {
                        "inputType": {
                            "enum": {
                                "select": "Dropdown list",
                                "radio": "Radio button list"
                            }
                        },
                        "options": {
                            "type": "array",
                            "friendlyName": "Options",
                            "description": "Options to select from",
                            "items": {
                                "type": "string"
                            }
                        }
                    }
                }
            ]
        }
    },

I've been looking at https://learn.microsoft.com/en-us/dynamics365/commerce/e-commerce-extensibility/configure-properties-context for help, but the text and examples seem to be mixed up. 

I have the same question (0)
  • Ramune Profile Picture
    on at

    Hi,

    I will leave it for the community to answer. Let's see if anybody has experienced the same and can advise for you anything.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Laurens vd Tang Profile Picture

Laurens vd Tang 299 Super User 2025 Season 2

#2
Siv Sagar Profile Picture

Siv Sagar 183 Super User 2025 Season 2

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 118 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans