Skip to main content
May 13, 2025
Question

Create Parent and Child records in single Script Node

  • May 13, 2025
  • 3 replies
  • 0 views

In my application I have a two record types with a One to many relationship.

recordType!Workflow -> recordType!Task.

I have process that needs to create a Parent record and child records.

Currently I have two Script Process Nodes. 

Process 1. Creates workflow record and store in pv!workflow.

Process 2. Creates multiple task records and appends to pv!workflowTasks.

Then I call Write records to store the records to the db.

My question is, do these have to be two seperate Script Process Nodes?  Or can I combine my logic into one Script Process Node where Output 1 creates the workflow record in pv!workflow and then the second output creates the task records and appends them to pv!workflow.tasks?

    3 replies

    venkatrea696188
    May 13, 2025

    Yes , It can be done and you don't even need second variable . Did you stuck some where ?? Or you just want to know whether it can be done or not?? https://docs.appian.com/suite/help/25.1/manage-record-data.html#create-records-and-related-records here is an example recipe  (Use dot notation for referencing related records)

    mathieud0001
    May 13, 2025

    You can do everything within a single expression and simply output to a PV (which using appends).

    harshas2775
    May 14, 2025

    Yes it is possible. But choosing to combine it into one or keeping them separate is up to your use case! Depending on complexity or number of child records, keeping can separate can be easier to manage or debug issues when any data error happens. If they are simple combining them is alright.