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
Đã hỏi vào Thứ Năm
Chris

This is specific to flows.

10 tháng 10 lúc 15:42
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 tháng 10 lúc 17:52
Câu trả lời được chọn
1

This is working now.

Thanks

11 tháng 10 lúc 13:22
Pablo