Appian Community and Appian Academy are being upgraded. From July 24–August 3, the Appian Community will be in read-only mode. During this time, the site will be read-only and user registration will be disabled. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!

The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.

local variable

Certified Senior Developer

hi, 

I have a local variable "array of object" ,

I need to update value "seenBy" for one field in all array objects,

 a!flatten(a!forEach(
            items:  local!msg,
            expression: {
                a!save(fv!item.id,fv!item.id),
                a!save(fv!item.isDeleted,fv!item.isDeleted),
                a!save(fv!item.createdBy,fv!item.createdBy),
                a!save(fv!item.messageText,fv!item.messageText),
                a!save(fv!item.convId,fv!item.convId),
                a!save(fv!item.createdOn,fv!item.createdOn),
                a!save(fv!item.seenby,concat(fv!item.seenBy, concat(tostring(loggedInUser()) , ",") ),
                ),

            }
          )

          ),
a!startProcess(
  processModel: cons!COM_Write_AllMsg_SeenBy,
  processParameters: {
    allmsg: ri!allmsg,
    
  }
),

but the issue is :- 

"An error occurred while trying to write to the data store [chatDS]. No values have been written. Details: Could not execute JDBC batch update (APNX-1-4208-004)"

I think its because the expression send empty object to the process model:-

" [id=, convId=, messageText=, createdOn=, createdBy=, isDeleted=, seenBy=]   ",

 I need something to send the same array of object with same data  and just update in "seenBy" field

  Discussion posts and replies are publicly visible

Parents Reply Children
No Data