We have a static container element whose repeating elements are set up in an API call response template. We can load the records into Create and create cases from them as described in this post by Adam Mills (@adam.mills) : Populating a data object with multiple entries returned through an API call - #4 by adam.mills
However, in the external system we merge records so that any number of external records are merged into 1 (external) record. It would be very useful to be able to fire an event if we have a match on a repeating element so that we can archive/transfer/hide via subset the records in Create which are not matched after the merge. Is there a way this can be done? I’m using Link in the template but I cannot fire an event on the match/link as I can do in the main API call.
Template - no ‘Event triggered by match’ option
API call - ‘Event triggered by match’ option is available
Would you be so kind as to clarify further exactly what you are looking to achieve please as it’s not clear to me.
Hi Adam, we have orphan records in Create after an operation is run in an external system. Given the options in the api call response template, there is no way to fire an event on a matched record in Create. So, I do not see how we can archive or hide the orphaned records.
Orphaned records in the child object because they existed before the API call ran and have not been linked to a parent?
If this is the case you can put them into a subset at the child level by creating a filter for where relatd parent id is empty. This will flag child records with no parents such that you can then do with them as you wish.
Apologies if this is not what you mean.
No. The records are orphaned because:
- They are created in the external system with a guid
- Then imported into Create via api with the same guid
- The merge operation in the external system then creates 1 record out of x number of merged records and then deletes the merged records.
- The new record is imported via api by Create with its guid and we are left with the x number of orphaned merged records and no way to hide or archive them.
If the records are orphaned at the end of the API process, could you run a signal schedule that coincides with your API schedule to then clean them out afterwards? I am making an assumption that their immediate existence does not cause any issues and they can simply be filtered out from UI/any other rules and cleaned out at a later time for data hygeine?
If they could easily be filtered out, that would be enough. However, there is no record status to distinguish them and also no way to match on repeating elements so we’re blocked on that at the moment.
Are the records coming from the API always new or is there a potential for change on them?
I am thinking maybe a signal that runs beforehand to remove all records from an event driven subset, then API call runs and a rules on fields changed or some other mechanism adds them back into the event driven subset. That way you have a clear membership left over of what was in the last run and what wasn’t and clean them out that way?
Thanks @adam.mills and @carl.robinson. It is working now using a combination of the change in relationship on the api object advised by Adam and the signal to remove records from an event driven subset by Carl.
Great news @markgpearson glad we could be of help.