Appian Community and Appian Academy are being upgraded. From July 24–August 3, the Appian Community will be in read-only mode. During this time, the site will be read-only and user registration will be disabled. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!

The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.

Conditionally Grey out ChoiceLabels for Checkbox field

Hi,

Could anyone suggest how can we conditionally grey out only some of the choiceLabels for checkbox field while displaying all the choicelabels to the user.

 

thanks in advance

  Discussion posts and replies are publicly visible

Parents
  • Hi ,

    While I think has the best solution to use an editable grid, I took this as a bit of a challenge because I think it may be a use case I would have at some point.

    Below is some example code I put together to show this functionality. Putting this into a live application will take some additional work, but shows the idea you are attempting to implement.

    load(
    local!options: {
    "A",
    "B",
    "C",
    "D"
    },
    local!disabledOptions: {
    "A",
    "C"
    },
    local!values,
    {
    a!richTextDisplayField(
    label: "Disabled Check Boxes Example"
    ),
    a!forEach(
    items: local!options,
    expression: a!checkboxField(
    labelPosition: "COLLAPSED",
    choiceLabels: fv!item & if(
    length(
    wherecontains(
    fv!item,
    local!disabledOptions
    )
    ) = 0,
    {},
    " - Disabled"
    ),
    choiceValues: fv!item,
    disabled: wherecontains(
    fv!item,
    local!disabledOptions
    ),
    value: index(
    local!values,
    wherecontains(
    fv!item,
    local!values
    ),
    null
    ),
    saveInto: a!save(
    target: local!values,
    value: if(
    isnull(
    save!value
    ),
    remove(
    local!values,
    wherecontains(
    fv!item,
    local!values
    )
    ),
    append(
    local!values,
    save!value
    )
    )
    )
    )
    ),
    a!paragraphField(
    label: "Saved Values",
    value: local!values
    )
    }
    )
  • Hi bradc,

    This code is not working for my use case since the values in checkbox are coming dynamically everytime. Also i thought of creating 2 diff. checkboxes one for disabled options and other one for non-greyed out options ,but it is not working since eveytime different value will come.Please could you suggest me how should i proceed?

    thanks in advance

Reply
  • Hi bradc,

    This code is not working for my use case since the values in checkbox are coming dynamically everytime. Also i thought of creating 2 diff. checkboxes one for disabled options and other one for non-greyed out options ,but it is not working since eveytime different value will come.Please could you suggest me how should i proceed?

    thanks in advance

Children