Skip to main content
Known Participant
Sep 26, 2022 11:12 AM UTC
Question

Relation in database not working.

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
    Sep 26, 2022 12:37 PM UTC

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

    Known Participant
    Sep 26, 2022 12:54 PM UTC

    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
    Sep 26, 2022 12:56 PM UTC

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