Conditional Links in a Grid field

 I have a Requirement to Show the Link when there status of the Participant is 1 and just show the Status as a text when the Status is 0 or 2

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    What appian version are you on? What code do you have so far?
  • +1
    Certified Lead Developer
    in reply to rohann179

    Please see the attached code snippet which demonstrates adding conditional dynamic links depending on presence of data in the current row for that column:

    /* example of conditional links on a paging grid using a!forEach() (Appian 17.2+ only) */

    load(
      local!test: {"Row 1", "Row 2", null(), "Row 4"},
     
      local!selected: "(none)",
     
      a!gridField(
        label: "Test Grid",
        instructions: "Selected: " & local!selected,
        totalCount: count(local!test),
        columns: {
          a!gridTextColumn(
            label: "Row #",
            data: a!forEach(local!test, fv!index)
          ),
          a!gridTextColumn(
            label: "Data",
            data: local!test,
            links: a!forEach(
              local!test,
              if(
                isnull(fv!item),
                null(),
                a!dynamicLink(
                  label: "grid link",
                  value: fv!item,
                  saveInto: local!selected
                )
              )
            )
          )
        },
        value: a!pagingInfo(1,-1)
      )
    )
Reply
  • +1
    Certified Lead Developer
    in reply to rohann179

    Please see the attached code snippet which demonstrates adding conditional dynamic links depending on presence of data in the current row for that column:

    /* example of conditional links on a paging grid using a!forEach() (Appian 17.2+ only) */

    load(
      local!test: {"Row 1", "Row 2", null(), "Row 4"},
     
      local!selected: "(none)",
     
      a!gridField(
        label: "Test Grid",
        instructions: "Selected: " & local!selected,
        totalCount: count(local!test),
        columns: {
          a!gridTextColumn(
            label: "Row #",
            data: a!forEach(local!test, fv!index)
          ),
          a!gridTextColumn(
            label: "Data",
            data: local!test,
            links: a!forEach(
              local!test,
              if(
                isnull(fv!item),
                null(),
                a!dynamicLink(
                  label: "grid link",
                  value: fv!item,
                  saveInto: local!selected
                )
              )
            )
          )
        },
        value: a!pagingInfo(1,-1)
      )
    )
Children