Whitespace Call Relations ships and Copying Data from one object to another

Hi folks,

I am currently working on a missed bins form to automate our missed bins reporting in to WhiteSpace.

I have created and set up all the relevant API Calls and Objects. However, I am having an issue with copying data from the call ‘GetSiteCollections’ to the ‘CreateWorksheet’. I need to copy three fields:

  1. ServiceItemID
  2. ServiceItemName
  3. ServiceItemQuantity

I have successfully made the call and have the data in the ‘GetSiteCollections Response’ data object, but when I create a rule to copy the data from the ‘GetSiteCollection Response’ object, to the ‘CreateWorkSheet’ data object, I do not get the option to choose the ‘one-to-many’ ‘GetSiteCollection’ Response object where the data has been saved.

However, if I change the ‘Act Upon Path’ to the ‘one-to-many’ ‘GetSiteCollection Response’ objects I can copy the data to the ‘CreateWorksheet’ data object, but it creates a new record, thus not allowing me to complete the ‘CreateWorkSheet’ call.

Any Help would be most appreciated as there is a deadline to have this form complete.

Thanks for any help,

I think I see what the issue you’re having is: where there is a 1:N and want to update an existing record in the :N side, a rule isn’t able to pick the record that needs updating, and will always save to a new record.

The way I would handle this is two relations between the same objects, a 1:N “all of them”, and a 1:1 “latest”, adding a rule that says when a relation is added on the 1:N, set the relation for the 1:N “latest” to be the newly-added relation. Then your rule can use the 1:1 “latest” as the path to use for its response.

This assumes, of course, that the one you’re trying to update is the most recent call. If it’s not, and what you’re trying to update is one of the middle 1:N records, you’re left with something a bit more complicated. But we’ll jump off that bridge only if we need to :slight_smile:

Hi Phil,

Thank you for the response. Sounds like a good fix, still having some issues though.

I have created the rule as followed, I believe I maybe using the wrong Response Action.

Create Object 1 1:N Object 2
Object 1 1:1 Object 2

Create Rule:

Trigger - Event: Relationship Changed
Relation: 1:N Object 2
Change: Added

Response: Action: Add relation
Relation: 1:1 Object 2

The Rule triggers and creates the 1:1 relationship, but no data is copied across, the detective dose not show any indication of copying that data although other data is copied in the same rule that does show.

Ah, yes - adding the 1:1 relation won’t copy anything else across
But… if you have another rule that triggers “On relation change” for the 1:1 relation, copy the values - does that then work?

Edit to add… make sure that the first rule triggered does not have “Apply changes silently” selected, or subsequent ones won’t fire

afraid not, I have created a second rule.

Trigger: Relationship changed
Relation: 1:1 Object 2
Change type: Added

Response: Copy value x from 1:1 Object 2 to Object 3

Hi William,

Should the second rule not be copying from Object 1 to Object 2?

Is the 1:1 relation being created between the right two records?
Can you see in the detective whether the second rule is being triggered?

Hi Phil,

Thank you for you help, a quick change of the relationships and it appears to be working, too well in fact lol, need a few subsets to limit the results lol.

Thank you for your help!

Hi Phil,

Another issue seems to have cropped up.

I can now copy the data out of the 1:N data object.

So I do a API call, 1:N GetSiteCollections and then use a rule to add a relation 1:1. I then try and copy the the SiteServceID from the 1:1 to a UpdateSiteServiceItem what works, however it create a new record.

So the data that has been copied to the UpdateSiteServiceItem is in another record. so I now have 2 records, Record A with all the data except the SiteServiceID and Record B with the SiteserviceID and I cannot seem to link/merge/transfer these records together so I can complete the UpdateSiteServiceItem call.

I hope that makes sense

I am under a time pressure to get this complete, so any help you can give would be very much appreciated