Hi all,
I have two SharePoint lists. Contracts and Contract_requests. The end user of my app can initiate multiple contracts at once, which are registered in the Contracts sharepoint list as separate records. In the contract_request table I want to create one entry that has a 'Contracts_linked' column that consists of a LookUp to entries created in the Contracts SharePoint list.
In order to accomplish this I use the action below to create a record for each contract (stored in the contract_dataset collection) in the Contracts Sharepoint List. Within the action I use a collect to create a MyPatchedRecords Collection to get back the records that were just created so I can use their ID in the follow up patch function. So far this is working well.
ForAll(contract_datasets As A;Collect(MyPatchedRecords;Patch(contracts; Defaults(contracts);{Titel: "test2"};{department:A.department};{justification:"test"})));;
Now I want to use a new Patch function to create one new record in the Contract_requests SP list that links to all other records that were just created in the Contracts SP list. In order to do this I have tried multiple things
Patch(Contract_requests; Defaults(Contract_requests);{Contracts: Filter(Contracts; ID in MyPatchedRecords.ID)};{Titel:"test");;
Error: Expects table type but expects different schema
Or tried:
Patch(Contract_requests; Defaults(Contract_requests);{Titel:"test"};{Contracts:Filter(Contracts; ID in Concat(MyPatchedRecords;'Id (ID)'))})
And I have tried many other variations using Lookup, Filter, etc. but can't make it work. Does anyone know what is going wrong here?
Thanks in advance!