Array property indexing and update

I have an array from selectable editable grid . Now i want to update value in the array under a particular property and then save that to the db. For saving to the database I am using writeToDataStoreEntity but i need to update some text and then submit for database save. Here is record from a selected row in the grid.

[acctType:(Investment-IRA) Prevailing Rate ,ppiStatus:Open,modifiedDate:4/11/2018 7:59 PM GMT+00:00,modifiedBy:steve.busser,createdDate:4/11/2018 7:59 PM GMT+00:00,createdBy:steve.busser,deadline:4/18/2018 12:00 AM GMT+00:00,ticketNumber:31,ppId:78]

I am trying to change ppiStatus to "Void", modifiedBy currentuser so on and so forth for the remaining fields.

Thanks

  Discussion posts and replies are publicly visible

Parents
  • Have you looked at casting it with a rule? for example:

    cast(
    'type!{urn:com:appian:ZOO}ZOO_pens',
    {
    id: if(isnull(ri!id), ri!pen.id, ri!id),
    name: if(isnull(ri!name), ri!pen.name, ri!name),
    photoId: if(isnull(ri!photoId), ri!pen.photoId, ri!photoId),
    dateAdded: if(isnull(ri!dateAdded), ri!pen.dateAdded, ri!dateAdded),
    addedBy: if(isnull(ri!addedBy), ri!pen.addedBy, ri!addedBy),
    status: if(isnull(ri!status), ri!pen.status, ri!status),
    type: if(isnull(ri!type), ri!pen.type, ri!type),
    isInactive: if(isnull(ri!isInactive), ri!pen.isInactive, ri!isInactive),
    inRepair: if(isnull(ri!inRepair), ri!pen.inRepair, ri!inRepair)
    }
    )

    You can then call this on your expression rule in an a!save, where you update the array with the expression. You can pass in the whole array, and also specify named variables so that those are updated properly. You can then call the WriteToDS function to save the array.

Reply
  • Have you looked at casting it with a rule? for example:

    cast(
    'type!{urn:com:appian:ZOO}ZOO_pens',
    {
    id: if(isnull(ri!id), ri!pen.id, ri!id),
    name: if(isnull(ri!name), ri!pen.name, ri!name),
    photoId: if(isnull(ri!photoId), ri!pen.photoId, ri!photoId),
    dateAdded: if(isnull(ri!dateAdded), ri!pen.dateAdded, ri!dateAdded),
    addedBy: if(isnull(ri!addedBy), ri!pen.addedBy, ri!addedBy),
    status: if(isnull(ri!status), ri!pen.status, ri!status),
    type: if(isnull(ri!type), ri!pen.type, ri!type),
    isInactive: if(isnull(ri!isInactive), ri!pen.isInactive, ri!isInactive),
    inRepair: if(isnull(ri!inRepair), ri!pen.inRepair, ri!inRepair)
    }
    )

    You can then call this on your expression rule in an a!save, where you update the array with the expression. You can pass in the whole array, and also specify named variables so that those are updated properly. You can then call the WriteToDS function to save the array.

Children
No Data