Required fields, if other field is empty

So I am very new at Appian and I have a question about required fields.

I have an interface with two sections:

In one section is just a field where one can enter an ID number.

The other section consists of several fields that are required, if the ID number of the first section is unkown.

So basically, I enter the ID number, the fields shoudl not be required, but as long as the ID field is empty all the other fields should be required.

 

Can anyone help?

  Discussion posts and replies are publicly visible

Parents
  • Have made some modifications in the code provided by Yoga.

    load(
    local!isRequired,
    local!val1,
    local!val2,
    a!formLayout(
    contents: {
    a!sectionLayout(
    contents: {
    a!textField(
    label: "Test1",
    value:local!val1,
    saveInto: {local!val1,
    if(isnull(local!val1),
    a!save(local!isRequired,null),
    a!save(local!isRequired,true())
    )

    },
    refreshAfter: "UNFOCUS"
    )
    }
    ),
    a!sectionLayout(
    contents: {
    a!textField(
    label: "Test2",
    value: local!val2,
    saveInto: local!val2,
    required: if(local!isRequired,false,true),
    refreshAfter: "UNFOCUS"

    )
    }
    )
    }
    )
    )

    This will help you. Try it out!!

    Thanks,
    Aditya.
Reply
  • Have made some modifications in the code provided by Yoga.

    load(
    local!isRequired,
    local!val1,
    local!val2,
    a!formLayout(
    contents: {
    a!sectionLayout(
    contents: {
    a!textField(
    label: "Test1",
    value:local!val1,
    saveInto: {local!val1,
    if(isnull(local!val1),
    a!save(local!isRequired,null),
    a!save(local!isRequired,true())
    )

    },
    refreshAfter: "UNFOCUS"
    )
    }
    ),
    a!sectionLayout(
    contents: {
    a!textField(
    label: "Test2",
    value: local!val2,
    saveInto: local!val2,
    required: if(local!isRequired,false,true),
    refreshAfter: "UNFOCUS"

    )
    }
    )
    }
    )
    )

    This will help you. Try it out!!

    Thanks,
    Aditya.
Children
No Data