So I have an interface that is saving two array of CDTs the idea I was having is that it would store each iteration of the array into its own respective row for the array example: {[uuid:1, fkuuid: ab32, date: today], [uuid:2, fkuuid: cd43, date: tomorrow]}. In the database there would be a row for UUID 1 and a row for UUID 2 but when I execute the write to data store entry I only get uuid 1. To push this even further I am doing this two times for separate tables and its only putting 1 entry into 1 table.
If there is any more information that is needed let me know! Any Ideas on how to get it to save all the information in the array of cdt to each of its separate rows?
Discussion posts and replies are publicly visible
Hey Kyle,
Are you using the smart service / function of Write to Data store. I assumed smart service
Could you attach some screenshots of the process variable you are trying to save and the configuration of your Write to Data store smart service
Quick thing to check:
- Are you marking the multiple checkbox of the Write to Data store ?
Also, look into the documentation. this could help
https://docs.appian.com/suite/help/21.4/Write_to_Data_Store_Entity_Smart_Service.html
https://docs.appian.com/suite/help/21.4/Write_to_Multiple_Data_Store_Entities_Smart_Service.html
These are my process variables and write to data store entity with the multiple checked on both.
well, you are trying to save multiple different entities (different CDT type) using a 'Write to Data Store Entity'.
This smart service can only write to 1 entity
You would need to use: 'Write to Multiple Data Store Entities'
You can look for an example here:
https://docs.appian.com/suite/help/21.4/Write_to_Multiple_Data_Store_Entities_Smart_Service.html#example-inputs-1
And according to your screenshot
let say if you have 2 Data store entity constants for your entity types
cons!MAP_DSE_PRODUCER - Entity type for CDT Map_Producer
cons!MAP_DSE_DATA_PRODUCER - Entity type for CDT Map_Data_Producer
You should put in the Data tab for 'Value to Store' as:
= { { entity: cons!MAP_DSE_PRODUCER, data: pv!mapProducer }, { entity: cons!MAP_DSE_DATA_PRODUCER, data: pv!mapDataProducer }}
Okay! I will try this and report back my success rate!
An error occurred while trying to write to the data store [TIMS]. No values have been written. Details: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1 (APNX-1-4208-004)I got this Error and my Node looks like this:
Well, I would suggest you preform some debugging on your data that you are trying to store.
It looks like you don't have any data to store as the actual row count received by the smart service is 0 according to the error
What are your process variables values of the process instance where this error occurred?
Alternatively, you could also use 2 individual 'Write to Data Store Entity', one for Map_Producer and another for Map_Data_Producer
My Process Variables are Arrays of CDTs:
Map Producer:[uuid=, mapUuid=bd88c105-3b1f-42d8-a3f5-5230c4510ee9, producerUuid=28319bc1-d6c9-4113-92bc-ca0cd9c8d1f9, prime=True, createdDate=1/11/2022 12:00 AM, createdBy=admin.user, lastUpdatedDate=1/11/2022 12:00 AM, lastUpdatedBy=admin.user],
[uuid=, mapUuid=bd88c105-3b1f-42d8-a3f5-5230c4510ee9, producerUuid=5ec6570b-ebf2-46c8-83ad-b9c182938264, prime=True, createdDate=1/11/2022 12:00 AM, createdBy=admin.user, lastUpdatedDate=1/11/2022 12:00 AM, lastUpdatedBy=admin.user],
[uuid=, mapUuid=bd88c105-3b1f-42d8-a3f5-5230c4510ee9, producerUuid=28319bc1-d6c9-4113-92bc-ca0cd9c8d1f9, prime=True, createdDate=1/11/2022 12:00 AM, createdBy=admin.user, lastUpdatedDate=1/11/2022 12:00 AM, lastUpdatedBy=admin.user]
^ This is the array of CDTs I am talking about with the write to data store entity that I had in store before it only saved the first iteration of it which would be the one in bold.
Map Data Producer:[uuid=, mapUuid=bd88c105-3b1f-42d8-a3f5-5230c4510ee9, producerUuid=5ec6570b-ebf2-46c8-83ad-b9c182938264, prime=True, createdDate=1/11/2022 12:00 AM, createdBy=admin.user, lastUpdatedDate=1/11/2022 12:00 AM, lastUpdatedBy=admin.user],
[uuid=, mapUuid=bd88c105-3b1f-42d8-a3f5-5230c4510ee9, producerUuid=28319bc1-d6c9-4113-92bc-ca0cd9c8d1f9, prime=True, createdDate=1/11/2022 12:00 AM, createdBy=admin.user, lastUpdatedDate=1/11/2022 12:00 AM, lastUpdatedBy=admin.user],
[uuid=, mapUuid=bd88c105-3b1f-42d8-a3f5-5230c4510ee9, producerUuid=5ec6570b-ebf2-46c8-83ad-b9c182938264, prime=True, createdDate=1/11/2022 12:00 AM, createdBy=admin.user, lastUpdatedDate=1/11/2022 12:00 AM, lastUpdatedBy=admin.user]
Thank you, Thank you, Thank you. The solution you provided worked.
Drive Mad
Bah.