Interrupción parcialshare-external
init-value of Inputs Hidden by IF no longer populate
2

As of today if a TextInput is hidden by an IF condition the init-value no longer populates once the IF condition evaluates to True and exposes the TextInput.

This was working yesterday.

Chris
Pregunta realizada hace aproximadamente un mes
Chris

This is specific to flows.

10 de octubre a las 3:42 p. m.
Pablo

Here is an example of the initial values not being populated inside an if. Select Option 1 first and the Option 2 and fields will appear but empty.

{
"version": "5.0",
  "screens": [
    {
      "id": "FIRST_SCREEN",
      "title": "Example",
      "terminal": true,
      "data": {
        "theDate": {
          "type": "string",
          "__example__": "2024-08-01"
        }
      },
      "layout": {
        "type": "SingleColumnLayout",
        "children": [
          {
            "type": "RadioButtonsGroup",
            "label": "Options",
            "required": true,
            "visible": true,
            "name": "optionsRadioGroup",
            "data-source": [
              {
                "id": "opt1",
                "title": "Option 1"
              },
              {
                "id": "opt2",
                "title": "Option2"
              }
            ],
            "init-value": "opt1"
          },

              {
                "type": "RadioButtonsGroup",
                "name": "optionsRadioGroup2",
                "label": "Sub Options",
                "visible": true,
                "required": true,
                "init-value": "opt1",
                "data-source": [
                  {
                    "id": "opt1",
                    "title": "Option 1"
                  },
                  {
                    "id": "opt2",
                    "title": "Option2"
                  }
                ]
              },
              {
                "type": "If",
                "condition": "${form.optionsRadioGroup2} == 'opt2'",
                "then": [
                  {
                    "type": "TextInput",
                    "required": true,
                    "label": "Amount",
                    "input-type": "number",
                    "name": "amount",
                    "init-value": "10"
                  },
                  {
                    "type": "DatePicker",
                    "name": "theDate",
                    "required": true,
                    "label": "Date",
                    "min-date": "${data.theDate}",
                    "init-value": "${data.theDate}"
                  }
                ]
              },
          {
            "type": "Footer",
            "label": "Submit",
            "on-click-action": {
              "name": "complete",
              "payload": {
              }
            }
          }
        ]
      }
    }
  ]
}
10 de octubre a las 5:52 p. m.
Respuesta seleccionada
1

This is working now.

Thanks

11 de octubre a la 1:22 p. m.
Pablo