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
+2
person also asked this
people also asked this
Replies
10 replies
Subscribers
6 subscribers
Views
5360 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Process
Hi forum, I am using the Delete from Data Store Entities smart servic
lincolnf454
over 11 years ago
Hi forum,
I am using the Delete from Data Store Entities smart service in a process. Whenever I try to assign the data store to delete from when configuring the properties, the node does not retain the data store I have assigned in the input. (see screenshot attachment). I am using Appian 7.2. Does anyone else have this issue?...
OriginalPostID-92395
OriginalPostID-92395
Discussion posts and replies are publicly visible
Top Replies
lincolnf454
over 10 years ago
+2
Hi Gary. Here are the steps I took to make this node work for me using a datastore named dsFruit as an example. 1. Ensure you have a process variable of type int holding the unique id(s) of the row(s)…
0
lincolnf454
over 11 years ago
Alright, I've worked out how to delete from my data store successfully. I have a new problem now though, it seems that only the id that I have assigned to delete from my db table is being deleted instead of the entire row. How can I get this node to delete an entire row with a given primary key?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
vimalkumars
Certified Lead Developer
over 11 years ago
Hi,
Can you check whether the passed Identifier value is the primary key?
Refer the following link for more information.
forum.appian.com/.../Delete_from_Data_Store_Entities_Smart_Service.
Hope this helps.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
lincolnf454
over 11 years ago
Hi Vimals.
I have definitely passed the primary key into the identifier. I am utilizing nested data stores and I am trying to delete an entity from a child data store. I don't know if that makes a difference with regards to assigning EntityDataIdentifiers to multiple values etc
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Steven Miccile
Appian Employee
over 11 years ago
As per the documentation, the entity and data values must be put into the value field for the EntityDataIdentifiers node input and not the entity and identifier fields of that input. The syntax should be the same as if using a write to multiple data store entity smart service:
={
{entity:pv!ENTITY_SPRINT_ITEMS, identifiers:pv!itemIdsToDelete},
{entity:pv!ENTITY_COMMIT, identifiers:pv!commitIdsToDelete},
{entity:pv!ENTITY_SPRINT, identifiers:pv!sprintIdsToDelete}
}
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Steven Miccile
Appian Employee
over 11 years ago
Also, if one CDT is truly nested within another, you should be able to save the updated parent CDT to the database from the highest level and the children will be added/updated/deleted accordingly. You may not need a separate delete from database node.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
lincolnf454
over 11 years ago
Hi Steven, thank you for your reply. I think I need to be a bit more descriptive about what I'd like to achieve in comparison to the result occurring. I have the parent db/CDT let's call this customers and the child db/CDT contacts. When prompted by the user, I'd like the delete from database node to remove a contact that the user has selected to delete. I would receive the relevant id from this selection and the inputs into the delete from database node would be as follows:
={entity:pv!ENTITY_CONTACTS, identifiers:pv!contactidstodelete}
into the 'data to delete' property. I gather from your answer and the documentation that the contacts id and it's entire row should be deleted from the contacts db, but what is actually occurring is that only the id is removed. The row that should be deleted from the db remains and gets assigned a new id.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
lincolnf454
over 11 years ago
Alright I figured out a solution to my own problem, it seems that I was writing old CDT values back to the DB after deleting from data store entities, this effectively did delete my id but reassigned old data to a new id.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
garym
over 10 years ago
Hi lincolnf454...I saw your post about the Delete from Data Store Entities smart service not retaining the data store. I am coming across the same issue. What did you do to get it to work?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
lincolnf454
over 10 years ago
Hi Gary. Here are the steps I took to make this node work for me using a datastore named dsFruit as an example.
1. Ensure you have a process variable of type int holding the unique id(s) of the row(s) you would like to delete form your database. Note that you can delete a single entity or many entities by either assigning this variable as single or multiple.
2. Ensure that you have created a process variable of type "Data Store Entity" and assign the value to you datastore (see screenshot below)
3.In the value entry on the delete from database node, enter in the following expression
={entity:pv!dsFruit, identifiers:pv!FruitIdentifiers}
Where entity is the variable from point 2 and identifiers is the variable from point 1. See second screenshot. Hope this helps.
Cancel
Vote Up
+2
Vote Down
Sign in to reply
Verify Answer
Cancel
0
garym
over 10 years ago
Thanks lincolnf454. I eventually found a post with a similar issue and figured it out. The documentation doesn't clearly state creating that pv of type Data Store Entity. Anyways, thanks again. It works now.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel