How to update a specific field in a CDT?

Hi,

I am looking for a way to update a CDT field after each step of a process.

I am building a recruiting process. After each user task in the process model I would like to update the candidate CDT and write that to the datastore. However when I try to do so, I end up creating a new line (a new candidate everytime). But actually I just want to update the existing candidate.

It should work something like this:

Initial dataset:

candidateId name phoneInterview OnSite
1 Emma null null

After the phone interview:

candidateId name phoneInterview OnSite
1 Emma true null

After the OnSite interview:

candidateId name phoneInterview OnSite
1 Emma true true

I do have a running application, but it uses a workarround. In addition to the candidate CDT I am using a phoneInterview and a onSite CDT. Both CDTs have a foreign key candidateId.

How, can I achieve the same only using the candidate CDT? Thanks.

Best regards Karl

  Discussion posts and replies are publicly visible

  • In order for you to update a row in the database you need to know the index for that record.  In other workds reference the candidateid when writting to the datastore.  You will need to know if it is an update to a row or if it is a new row.  If you want a new row don't reference the id, but for existing rows reference the id.

  • Hi Karl,

    Please validate if you're collecting properly the candidateId field. I assume that field is your database primary key. That field must have the correct value before executing the Write To Data Store Entity. If that value in your CDT is empty, it will create a new row in your database. If the value of that field is an existing Id in your database, it will update that particular row.

    I suggest you run your Process Model in Debug Mode in order to validate if your CDT has the correct value in it.