Add Row Link with a record type

Certified Associate Developer

Hi!

I'm new to Appian records, been working with a really outdated version until now.

I'm trying to do a sort of properties interface where a user can add new values into properties but I can't seem to make a new row of records, here's the code

a!localVariables(
  local!properties:rule!MM_getPropertiesByType(type: ri!propertyType),
  local!addAux,
  {
  a!gridLayout(
    label: ri!propertiesLiteral,
    labelPosition: "ABOVE",
    headerCells: {
      a!gridLayoutHeaderCell(label: ""),
      a!gridLayoutHeaderCell(label: "Value"),
      a!gridLayoutHeaderCell(label: "")
    },
    columnConfigs: {
      a!gridLayoutColumnConfig(
        width: "ICON"
      ),
      a!gridLayoutColumnConfig(
        weight: 10
      ),
      a!gridLayoutColumnConfig(
        width: "ICON"
      )
    },
    rows: {
      a!gridRowLayout(
        contents: {
          a!richTextDisplayField(
            labelPosition: "COLLAPSED",
            value: {
              a!richTextIcon(
                icon: "arrow-up"
              ),
              a!richTextIcon(
                icon: "arrow-down"
              )
            }
          ),
          a!textField(
            value: local!properties.value,
            saveInto:{
              local!properties.value
              /*a!save(*/
                /*'recordType!{5ebb976a-556f-4033-b1d7-9e5976ab963d}MM Property',*/
                /*'recordType!{5ebb976a-556f-4033-b1d7-9e5976ab963d}MM Property'.(*/
                  /*'recordType!{5ebb976a-556f-4033-b1d7-9e5976ab963d}MM Property.fields.{041a7f43-dfd1-4b07-aaed-48e305712f4e}value':local!properties.value,*/
                  /*'recordType!{5ebb976a-556f-4033-b1d7-9e5976ab963d}MM Property.fields.{54637987-ef12-4057-b4c3-c898561cb626}type':ri!propertyType,*/
                  /*'recordType!{5ebb976a-556f-4033-b1d7-9e5976ab963d}MM Property.fields.{832f6a1b-9643-4fd5-a389-0556c2ee74a6}order':fv!index,*/
                  /*'recordType!{5ebb976a-556f-4033-b1d7-9e5976ab963d}MM Property.fields.{2612aa2c-ca09-4a4f-87a1-f66b6f08303c}modifiedOn':now(),*/
                  /*'recordType!{5ebb976a-556f-4033-b1d7-9e5976ab963d}MM Property.fields.{39dea2b9-c9f9-4b57-9aeb-62cf86ab5656}createdBy':loggedInUser(),*/
                  /*'recordType!{5ebb976a-556f-4033-b1d7-9e5976ab963d}MM Property.fields.{18bf5c84-4f3f-4566-a572-6d8ba5dd5285}active':true*/
                /*)*/
              /*)*/
            }
          ),
          a!richTextDisplayField(
            labelPosition: "COLLAPSED",
            value: {
              a!richTextIcon(
                icon: "check"
              ),
              " ",
              a!richTextIcon(
                icon: "times"
              )
            }
          )
        }
      )
    },
    shadeAlternateRows: true,
    addRowLink:a!dynamicLink(
      label: "Add",
      saveInto: {
        a!save(
          local!properties,
          append(local!properties,'recordType!{5ebb976a-556f-4033-b1d7-9e5976ab963d}MM Property')
        )
      }
    )
  )
}
)

Can someone explain how I might do this?

with this code when I try to add a row i get this: "Interface Definition: Expression evaluation error [evaluation ID = 8VMFS] : An error occurred while executing a save: Expression evaluation error at function 'append' [line 75]: Could not cast from RecordType to MM Property. Details: CastInvalid"

Thank you

  Discussion posts and replies are publicly visible