Append empty value to record

I have a record used in an interface and I want, as I press a dynamic link, in the save() part to add an empty vale to the array of the record, to do this I try a!save(recordtype,append(recordtype,save!vale) the save!value is the recordtype(), but it says it doesn't allow appends to records, how do I do it? I don't have much experience with records still.

I need this because I have a foreach with that recordtype as the item so I need a new row when I press the dynamic link so I can fill the fields that should appear

Thank you

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    You need to make sure that your rule input or whatever you're using for the list has the proper type and needs to be set to an array.

    Hope this helps,

    {
      a!richTextDisplayField(
        value: a!richTextItem(
          text: "Add user",
          link: a!dynamicLink(
            saveInto: {
              a!save(
                ri!userRecords,
                append(
                  ri!userRecords,
                  'recordType!{SYSTEM_RECORD_TYPE_USER}User'()
                )
              )
            }
          )
        )
      ),
      if(
        a!isNotNullOrEmpty(ri!userRecords),
        a!richTextDisplayField(
          value: a!richTextBulletedList(
            items: ri!userRecords['recordType!{SYSTEM_RECORD_TYPE_USER}User.fields.{SYSTEM_RECORD_TYPE_USER_FIELD_displayName}displayName']
          )
        ),
        {}
      )
    }

Reply
  • 0
    Certified Lead Developer

    You need to make sure that your rule input or whatever you're using for the list has the proper type and needs to be set to an array.

    Hope this helps,

    {
      a!richTextDisplayField(
        value: a!richTextItem(
          text: "Add user",
          link: a!dynamicLink(
            saveInto: {
              a!save(
                ri!userRecords,
                append(
                  ri!userRecords,
                  'recordType!{SYSTEM_RECORD_TYPE_USER}User'()
                )
              )
            }
          )
        )
      ),
      if(
        a!isNotNullOrEmpty(ri!userRecords),
        a!richTextDisplayField(
          value: a!richTextBulletedList(
            items: ri!userRecords['recordType!{SYSTEM_RECORD_TYPE_USER}User.fields.{SYSTEM_RECORD_TYPE_USER_FIELD_displayName}displayName']
          )
        ),
        {}
      )
    }

Children