Hi everyone
i m struggling with the process modeling when i need to write multiple rows in a DB ,
i have a CDT of "Documents" which i put as an array in my form and a CDT of "creditRequest" which contains an array of the Documents CDT.
i need to put both of them in seperate databases , the first one is the documents which i want to store and then after to store the creditrequest which will contain the documents.
now when i debugging my process i can see that my documents don't have an ID after that it s passing the "write to db",
and then after i have problem with the creditrequest ,
how i need to do for write the multiple documents that i want to write in the db and then write them in the next Db of Creditrequest ???
Discussion posts and replies are publicly visible
Hi, create two process variables, one for documents cdt and another for credit request cdt and using script task get the data for these two variables then using write to datastore entity or multiple datastore entities, you can write these data easily.
Hello yanivb,PA_Documents is nested into PA_Creidtrequest. first of all you don't need to store nested CDT additionally to the "main" CDT. So i looks like you have it twice in. Once as part of the nested CDT construct, second completly sperated as own array. Your decision should be: is there any other context, I need to call for this document? If not, you can consider nested, if there is another posisble context don't do it and use foreign keys.Personally i prefer working with DB views and foreign keys rather than nested CDT.some input: Custom Data Type (CDT) Relationships - Appian 21.4
1.) the first question would be, if nested is your desired solution?2.) why do you want to store them twice? Once as nested, once as seperat DB value?on top: Did you declare "ID" of PA_documents as primary key and turned "auto increment" on?additionally you didn't check "multiple" at your "Write to datastore" node. ;) ("stored value" output maintained?)
kind regards,
Richard
i used two process variables one for the documents cdt and the other for credit request cdt as you said . i wrote the data to document entity first and then wrote in the credit request entity .
after insertion of my data to the db. of documents, I can see that he did the relation between each document and the credit request db as i wanted , but i noticed in the debugger that for the process variable document it didn't wrote the ID for each one , but in my db each one got one .
because after when im looking to the id in the creditrequest entity i cant see the id
you know what is the problem ?
hi yaynivb,that is because you are lookin here into the DB table of the nested CDT.(check your stored values of the credit request)But you try to store it a second time.What is the purpose of it?
Did you save the documents process variable after writing to db?
this is what i have in creditrequest ,
i need to store the documents in db and the creditrequest also they have different databases
this how i defined the datatype
Could you please show snaps for both write to datastore entity node configuration?
Hi folks,i wouldnt fokus here specifically on the storing issue.There is more than one thing not really proper.1.) Like nested cdt in nested cdt2.) Storing logic itselfCan you show the output tab of your first "write to datastore" (i think its credit request)?
which one ? of the documents data store ?