Nested arrays issues

Hi team, I am brand new to jsonforms. I am having hard time rendering nested arrays. I tried with providing the UISchema and without providing it. The child array ui says no applicable renderer found. any help would be appreciated

[original thread by Adham Abu Dari]

Hi @aksdari, thanks for your interest in JSON Forms. To help you we need more information. Which renderer set of JSON Forms did you use? Can you post your schema and uischema?

[Louis]

Hi, I am also having this issue. Do you think you could help me out Stefan?

[Louis]

I declared an array “Workflow” where a form submitter can submit 1 or more workflow. For each “Workflow”, a form submitter can also submit 1 or more “Workflow Rules”. I believe i have the correct schema, but im having trouble rendering a UI. When i try to render this on react, for some reason it calls the schema for the entire object…
Schema-

    "Workflow_test": {
      "type": "array",
      "items": {
        "type": "object",
        "properties" : {
          "Rule_name": {
            "type": "string"
          },
          "rule_condition": {
            "type": "string"
          },
          "message_value": {
            "type": "string"
          },
          "rule_action_list": {
            "type": "array",
            "items": {
              "action_type":{
                "type": "string"
              },
              "enum": [
                "Modify fieldName",
                "Validate DQL"
              ]
            },
            "field_name": {
            "type": "string"
            },
            "operator_type": {
              "type": "string",
              "enum": [
                "APPEND",
                "SET",
                "MINUS",
                "ADD"
              ]
            },
            "mod_value": {
              "type": "string"
            },
            "validate_dql_stmt": {
              "type":"string"
            }
          }
        }
      }
    }

[Louis]

ui schema-

{
"type": "Group",
"label": "Workflow Test",
"elements": [
{
"type": "HorizontalLayout",
"elements": [
{
"type": "Control",
"scope": "#/properties/Workflow\_test"
}
]
}

[Louis]

[Louis]

react render -

Hi @louismonte(louismonte) I took a look. On the first glance everything looks fine in your screenshots or is there something what I’m missing? How would you expect JSON Forms to render your schema and ui schema?

[Louis]

Hi Stefan, thanks for the response! So the problem is in the actual render. In the last screenshot of the actual application render, Rule Action List, should be an array that contains the fields action_type, field_name, operator_type, mod_value, and validate_dql_stmt. Instead the render is producing a form of all the fields in schema.json (BA Internal Name, BA Display Name, BA Prefix, ect.). You can see this in the last screenshot. Let me know if this is still confusing. I can draw out how I expect it should look. TY!

Ah I see, sorry missed that on the first glance, I was looking for no applicable renderer found messages in the screenshots :wink:

Your JSON Schema seems to be incorrect, but maybe this is just an artifact from posting it here? The rule_action_list items should be a single object, e.g.

      "rule_action_list": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "action_type": {
              "type": "string",
              "enum": ["Modify fieldName", "Validate DQL"]
            },
            "field_name": {
              "type": "string"
            },
            "operator_type": {
              "type": "string",
              "enum": ["APPEND", "SET", "MINUS", "ADD"]
            },
            "mod_value": {
              "type": "string"
            },
            "validate_dql_stmt": {
              "type": "string"
            }
          }
        }
      }

Can you check whether it then works as expected? I can more easily take a look when you could post a complete JSON Schema and ui schema which I can just throw into our react seed.

[Louis]

ok thanks for getting back! will test this out right now. Give me a few!

[Louis]

Yes that fixed it! Thank you so much for the help!

Glad to help :wink: