Delete Data from multiple Data Store Entities at once

Hi All, 

I've read through most other relevant questions/posts to this but still couldn't get it to work. I have added a related action to one of my Records so that it can be deleted and associated this interface with a basic deletion process model with the Delete from Data Base smart service.  

First, in my interface I've got 3 inputs: action, studyProfile, and sites. The sites CDT has the studyProfile ID within it as there is a many-to-one relationship (one profile may have several sites).  What I'm trying to do is pass the Primary Key of each CDT (studyProfileID and however many siteID's there may be) into the process model so that it may delete them from the DB through the Delete from DB smart service node. 

1. I can see that the CDT's populate all values that I want when testing inside the Interface, but when using the Related Action with this Form, the values for the "sites" Process Variable don't seem to be getting passed in -- what am I doing wrong? 

2. Another post mentioned I need to have separate Data Store variables added so that the Delete node would work -- why is this necessary? It seems to be half working right now and I don't have them added. Here is how the Delete node is configured: 

I don't know if this node is not correctly configured, but there are 2 data store entities that I want to delete from and from one of those there are several primary key's to delete. Is it possible to do all of this inside the one node? I tried to separate them out into 2 nodes (one to delete from each DSE) but it still didn't want to delete the array of sites (probably because they're not being passed into the process to start with). 

Thanks for any help! 

  Discussion posts and replies are publicly visible

Parents
  • Hi Sarah,
    AFAIK, you are getting values in pv!studyprofile because you are passing studyProfileID from Related action, so only those values will be populated in the underlying Process model which are being passed from Related action (In your case you are not passing sites ID from related action that's why it is not populating in PM).
    If you want to delete all the SitesID from DB on the basis of studyProfileID then I guess there is some issue with foreign key relationship between tables containing studyProfileID and sitesID, because as per my knowledge for Delete from data store Entities smart service, deleting the parent in a one-to-many containment relationship also deletes the children.
  • Success!! Thanks so much for the insight -- I was able to get it to work by merely updating the variables being passed in from the Related Action ( I had forgotten to after adding the site Input in the interface and PM ). It works! Thanks again
Reply Children
No Data