write multiple rows in database in process modeling

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

Parents
  • 0
    Certified Senior Developer

    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

Reply
  • 0
    Certified Senior Developer

    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

Children
No Data