Skip to main content
stephaniek0003
Known Participant
Sep 6, 2023 1:14 AM UTC
Question

Write Record multiple rows from array process variable

Hi all -

I'm trying to create multiple rows in my record, using data that is stored as an array process variable.  But i'm getting all the data in a single row.  Could use some guidance. Here's what I've got:

1. My process calls a business rule which gives me the following output:

List of Text String - 3 items

    • "Asset Transfer"(Text)
        • "Disclosure"(Text)
            • "Identification"(Text)

            2. I've tried storing both in a record input as well as a process variable, those fields look like this:

            3. I'm using Write Record and would like to create one row for each of these, but instead I get one row with that exact list of strings.

            How do I get one row reach each item? Thanks in advance.

              4 replies

              mathieud0001
              Genius
              Sep 6, 2023 1:31 AM UTC

              The PCO Required Documents PV needs to be changed to support multiple values.

              Then you can do a forEach to iterate over the items in your string array to create your PCO Required Document array.

              stephaniek0003
              Known Participant
              Sep 6, 2023 10:53 AM UTC

              I do have the multiple checked in the pv.

              Can you tell me where I do this forEach loop? I thought the Write Record handeled that naturally without this. Can you give me more info on where in my process to put this loop?

              stefanhelzle0001
              Brainy
              Sep 6, 2023 10:58 AM UTC

              The write records node can only write lists of records. Not a list of text strings. Use a!foreach() in an expression rule to iterate on the text strings and create the required record data type items.

              docs.appian.com/.../reference-records.html

              Participating Frequently
              Sep 6, 2023 5:05 AM UTC

              Hi [mention:58eba8daf5e844d38e962d7b268d0a7f:e9ed411860ed4f2ba0265705b8793d05]

              The PCO Required Documents PV needs to be modified to accommodate multiple values.

              Afterward, you can utilize a forEach loop to iterate over the elements in your string array, creating your PCO Required Document array. Added image for reference.