Hi, I am working on our pest control service and its integration into whitespace, one of the requirements is to update multiple Service Properties on the worksheet.
I have created my API data and response objects and then created a one to many connection to a service property.
My thinking of this is I could add multiple service properties to service property data object and the would then add as extra lines in the create work sheet API call.
This does not seem to be the case, it will only ever add a single Service Property to the call.
This is my section of the create worksheet API call
Would someone be able to point me in the right direction to be able to add multiple Service Properties into a single Create Worksheet API calls.
That should work fine as, because you’ve specified a to-many relationship, it will send an array containing one or more sets of ServicePropertyId and ServicePropertyValue.
Have you checked the actual payloads being sent, in your API Request object, to see the raw data?
Hi Bob, thanks for your reply,
This is the data payload,
{“parameters”:{“worksheetInput”:{“Uprn”:null,“AccountSiteId”:null,“ServiceId”:null,“Usrn”:null,“WorksheetReference”:null,“WorksheetMessage”:null,“WorkLocationAddress”:null,“WorkLocationName”:null,“WorkLocationLatitude”:null,“WorkLocationLongitude”:null,“WorkLocationNorthing”:null,“WorkLocationEasting”:null,“WorksheetStartDate”:null,“WorksheetDueDate”:null,“ServiceItemInputs”:{“Input.CreateWorksheetInput.ServiceItemInput”:{“ServiceItemId”:null,“ServiceItemName”:null,“ServiceItemQuantity”:null}},“ServicePropertyInputs”:{“Input.CreateWorksheetInput.ServicePropertyInput”:[{“ServicePropertyId":null,“ServicePropertyValue”:"ashfield@gmail.com”},{“ServicePropertyId”:“1007”,“ServicePropertyValue”:null}]},“AdHocRoundInstanceId”:null,“RoleId”:null,“RoleName”:null}}}
I have managed to get it to add more then one Service property, but it now seems to be splinting the value and the id, and also leaving out the other data needed like UPRN and service ID…
I’m going to assume it is something to do with the relationship of rules copying/setting the values and IDs.
I will have a play with the Rules and double check the relationship paths to make sure they match and all the data is in the same place and give you an update if it still does not work. 
Thanks for your help!
Yes that looks to me like there are actually two records, and each only has one of the two values. So might be an issue upstream with how those records are being created.
If you temporarily swap your ServicePropertyId field to use the “ID” Attribute, you can confirm that, if you see two different record IDs in the payload.