Write to data store entity: Is there a way to get number of rows successfully wr

Certified Associate Developer
Write to data store entity: Is there a way to get number of rows successfully written to DB after this call other than running another query?

OriginalPostID-194328

OriginalPostID-194328

  Discussion posts and replies are publicly visible

  • @maheshp To the best of my knowledge, each and every record (new or existing) you input to this smart service will be updated in the database. If there is any problem even with a single record, the smart service ends in failure without making any updates.

    If your intention is to only identify the newly inserted records without making a query, then a difference in the primary key attribute between the PV (you input to the smart service for writing into DB) and the 'Stored Values' (output of 'Write to Data Store Entity' smart service) should give you the newly inserted records.

    If your intention is to identify the updated (newly inserted or modified) records, then 'Stored Values' (output of 'Write to Data Store Entity' smart service) is the one which will help you in identifying so.

    Let's see if any other practitioner can provide their valuable inputs.
  • Hi Mahesh, as shiva mentioned you can use the stored values or if you do not need the key values assigned and not using stored values from output you can rely on the logic below

    Upserts - array length of input
    Insert - number of rows in input with id column null
    Update - number of rows in input where Id column populated
  • 0
    Certified Associate Developer
    Thank you guys. I get the idea now.