Copy list of items AND referenced items

Is this possible…

Say I have users with 2 roles: admin and member.

Each admin contains a list of members (all are the same data type: user)

Is it possible to use the “copy a list of things” action and when admins are copied, the references to their members go to the member copies rather than the original?

Currently Happening:
Admin 1

  • member 2
  • member 3
  • member 4

COPY LIST

Copy of Admin 1 (new)

  • member 2 (original)
  • member 3 (original)
  • member 4 (original)

Separately, copy of member 2, copy of member 3, and copy of member 4 are also created but unattached.

What I want to Happen:
Admin 1

  • member 2
  • member 3
  • member 4

COPY LIST

Copy of Admin 1 (new)

  • copy of member 2 (new)
  • copy of member 3 (new)
  • copy of member 4 (new)

I understand why it’s doing this - the original data reference is copied. I’m having a hard time wrapping my head around how to replace the original members with their copies. I’ve tried to make a change to a list, but then I can’t reference individual items in the list because I’m changing a list within a list. Any ideas?

1 Like

@romanmg Did you solve this issue ? I am looking for a way to do this as well

Or is it a way to run a custom event on a list of things ?

For now I did a very UGLY thing :
Let’s say I want to copy a list of things of type A, each containing a list of things of type B.
I created a custom event that for a given thing of type A, replace the list of B things by a copy of this list.
I assumed that my list does not contain more than 10 elements of type A.
First I copy the list of elements of type A.
Then I call my custom event 10 times in a row, on each item of A, using “item # X” and a conditional that check that the list of A things has a count greater or equal to X.

But as I said, this is ugly, a solution to this would be more than welcome.
I know we can achieve similar thing using scheduled API workflows on a list, but then it will be asynchronous…

1 Like

Hi @florent.bocquelet,

Yes, knowing a little more now, this is how I would have achieved my issue…

  1. Create a new Admin with the same field values as the original except for members.
  2. Copy a list of things (admin’s members)
  3. Make a change to step 1’s admin: members add list result of step 2.

I think that actually would have gotten it.

1 Like

Hi Gaby,
This works if you want to copy an Admi that has a list of members.
But waht happens to copy a list of Admins, each having a list of members (that you want to copy as well) ?

Right… Ok, try this flow:

Schedule API workflow on a list: list of Admins

In the API Workflow: Create a new Admin with same fields (except for member) as “This Admin” > Copy a list of things: This Admin’s Members > Make a change to step 1: Members add list result of step 2.

1 Like

Yes I thought about that, but I am concerned by the fact that this is asynchronous.
What happens if the Admin’s list is modified while being copied ?