Skip to main content
September 26, 2022
Question

Relation in database not working.

  • September 26, 2022
  • 5 replies
  • 0 views

I am  facing problem  in developing project.

I made relation in two table in appian cloud database. But when i insert data foreign key id is not inserted in second table. see the below screenshot

when document data inserted , request_id (2nd column) will be null. 

    5 replies

    stefanhelzle0001
    Brainy
    September 26, 2022

    Appian will not automatically insert your id in that second table.

    September 26, 2022

    if(
    rule!APN_isBlank(
    pv!documentDetails
    ),
    null,
    a!forEach (
    items: pv!documentDetails,
    expression: rule!CRP_constructNonDevDocumentDetails(
    docId: fv!item.docId,
    docType: fv!item.docType,
    requestId: pv!NondevProjectDetails.id,
    documentId: fv!item.documentId,
    isactive: fv!item.isactive,
    uploadedBy: fv!item.uploadedBy,
    uploadedOn : fv!item.uploadedOn
    )
    )
    )

    I map data of documentdetails as per above in process model and then after i store it in document table using store multiple entity. Above requestId is foreign key and i used main table id to assign to that.

    stefanhelzle0001
    Brainy
    September 26, 2022

    OK, did you check the data in the process? Appian will write that value only if assigned and not-null.