Skip to main content
Participating Frequently
Jan 7, 2025 11:24 AM UTC
Question

Write related records

I have 3 records having one to many relationship  Timesheet(ID,IS_ACTIVE), Audit(ID,TIMESHEET_ID,IS_ACTIVE) and Comments(ID,AUDIT_ID,TIMESHEET_ID). When I tried to use single write records smart service, I am not able to populate value for TIMESHEET_ID column value in "Comments" table. Is it expected or do we have any other way to handle this?

    9 replies

    gundamanen723137
    Participating Frequently
    Jan 7, 2025 11:34 AM UTC

    You mean to say you can bale to populate timesheet id in Audit but not able to populate in Comments.

    Participating Frequently
    Jan 7, 2025 11:41 AM UTC

    Yes correct. In write records, the record input is "Timesheet". Record structure will be like below


    Timesheet(

    ID:1,

    IS_ACTIVE:1

    AUDIT*(

    AUDIT(

    ID:1,

    TIMESHEET_ID:1,

    COMMENTS*(

    COMMENTS(

    ID:1,

    TIMESHEET_ID:null,

    AUDIT_ID:1

    )))))

    stefanhelzle0001
    Brainy
    Jan 7, 2025 11:55 AM UTC

    When writing the main record plus related records to the DB, Appian will take care of the foreign keys, when you configure your relationships correctly.