Skip to main content
June 1, 2022
Question

Adding rows at specified position in a grid

  • June 1, 2022
  • 8 replies
  • 0 views

Hi,

I need to add a grid row right after I cloned(click on a link) the first one. I have used insert function for that.

But still, the row is adding before the main row i.e at the starting of the grid rows

Co

a!richTextItem(
          text: a!richTextIcon(icon: "Add", caption: "Create Rows"),
          link: a!dynamicLink(
            value: ri!data[ri!index],
            saveInto: {
              a!save(
                ri!data,
                insert(
                  ri!data,
                  'type!{urn:com:appian:types}C_CDTName'(
                    Id: ri!data[ri!index].Id,
                    HeaderLine: ri!data[ri!index].HeaderLine,
                    Desc: ri!data[ri!index].Desc,
                  ), (wherecontains(ri!data[ri!index],ri!data)),
                )
              ),
          ),
          linkStyle:"STANDALONE"
        ),


Could anyone please help me on the above issue. Thanks in advance

    8 replies

    gopalk2865
    Participating Frequently
    June 1, 2022

    HI Akhil, Could not understand your requirement exactly. could you please explain little bit more?

    June 1, 2022

    Hi Gopal,

    In a grid row layout, I have provided an icon at the end of each grid row. Once I click on that icon, new row with the data should get appended to the layout. For example if we have 5 rows and we cloned the first row, the new row should get added in the second position. But right now with the above code, it is getting added in the first position.

    stefanhelzle0001
    Brainy
    June 1, 2022

    The insert function takes an index for where to add the item. Your definition of that index seems weird. Did you try just ri!index? And does ri!index contain the expected value?