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

Parents
  • 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.

Reply
  • 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.

Children
No Data