Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
6 replies
Subscribers
5 subscribers
Views
2375 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Integrations
Hi, I have created a process model which calls a WebService using Cal
vbhardwaj
Certified Senior Developer
over 8 years ago
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
0
GouthamKrishna
over 8 years ago
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.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
GouthamKrishna
over 8 years ago
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.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data