Configure Write to DSE - updating single field

Online Course | Learning at Appian

In the video it is stated that if you save at the top-level, all fields are updated, which implies that if you save at the level of specific fields only those fields will be saved. Is this true?

I found out, instead null values are being inserted.

  Discussion posts and replies are publicly visible

Parents
  • What is saved is whatever is in the scope of the CDT you are using to map to the target datastore entity. So if you have a CDT with 5 attributes, and you set the third one to a value and leave the others blank then the update that is performed is for ALL 5 attributes - attributes 1,2,4 and 5 will be set to null, and attribute 3 to whatever value you set it to.

    If you only want to set a single attribute or a subset of the columns in your database table you have two choices:

    • you can create a "partial CDT" - that is, a CDT that maps to the same entity but only has the attributes you want to update
    • you can write a Stored Procedure to only update the columns you specify 

    ...or you can (as I've just seen in   comment, accept that you retrieve the entire scope of your CDT, update the attribute you want to change, and write the whole CDT back to the table which in effect overwrites the entire row, all with the original values except for the one you changed.

Reply
  • What is saved is whatever is in the scope of the CDT you are using to map to the target datastore entity. So if you have a CDT with 5 attributes, and you set the third one to a value and leave the others blank then the update that is performed is for ALL 5 attributes - attributes 1,2,4 and 5 will be set to null, and attribute 3 to whatever value you set it to.

    If you only want to set a single attribute or a subset of the columns in your database table you have two choices:

    • you can create a "partial CDT" - that is, a CDT that maps to the same entity but only has the attributes you want to update
    • you can write a Stored Procedure to only update the columns you specify 

    ...or you can (as I've just seen in   comment, accept that you retrieve the entire scope of your CDT, update the attribute you want to change, and write the whole CDT back to the table which in effect overwrites the entire row, all with the original values except for the one you changed.

Children
No Data