Hi, I have created a process model which calls a WebService using Cal

Certified Senior Developer
Hi,

I have created a process model which calls a WebService using Call Webservice Smart Service to fetch the records and then inserts/updates the records in the mySQL database using Write to data store Smart Service. The Webservice returns 1192 records and 115 distinct records are inserted into the database, which is perfectly fine as one of the field in Webservice output schema is a PK in the table. Hence it would insert only distinct values into the table. But the problem is "Stored Values" on output tab of Write to datastore has 1192 records, it should have 115 records which were inserted into the database.
Please suggest, how will I get to know how many records were inserted into the database.

Thanks in advance,
Vikrant.

OriginalPostID-168920

OriginalPostID-168920

  Discussion posts and replies are publicly visible

Parents
  • Hello Vikrant, ac!StoredValues seems to be returning one record multiple times. This might be because the "Write to DS entity" node tries to update a DB record multiple times each time when it recognizes a record with same PK is inputted, AND this node will return a record multiple times as the number of times it was altered(+1 of course for the newly added row) through ac!StoredValues o/p, but by yielding only latest values for a record and for a given PK. So I guess you can use a script task after this node and use fn!union(pv!StoredValues, pv!StoredValues) code to filter out any duplicate records.
Reply
  • Hello Vikrant, ac!StoredValues seems to be returning one record multiple times. This might be because the "Write to DS entity" node tries to update a DB record multiple times each time when it recognizes a record with same PK is inputted, AND this node will return a record multiple times as the number of times it was altered(+1 of course for the newly added row) through ac!StoredValues o/p, but by yielding only latest values for a record and for a given PK. So I guess you can use a script task after this node and use fn!union(pv!StoredValues, pv!StoredValues) code to filter out any duplicate records.
Children
No Data