# Related data bulk creation

**URL:** <https://community.forestadmin.com/t/related-data-bulk-creation/1573>\
**Category:** Help me!\
**Created:** [January 6, 2021, 11:16am UTC](https://community.forestadmin.com/t/related-data-bulk-creation/1573 "2021-01-06T11:16:35Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![daweido](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/daweido/32/1360_2.png) [@daweido](https://community.forestadmin.com/u/daweido)\
**Post date:** [January 6, 2021, 11:16am UTC](https://community.forestadmin.com/t/related-data-bulk-creation/1573/1 "2021-01-06T11:16:35Z")

</div>

Hey everyone,

I’m trying to implement carousel’s on the frontend of my application, and controlled through Forest Admin but can’t seem to make it work correctly.

## Expected behavior

Basically, I have a Carousel model and a CarouselPhotos model. I have created a _hasMany_ relationship on the Carousel model to the CarouselPhotos model.

This means that I have the related data section on carousel data:

 ![CleanShot 2021-01-06 at 12.11.58](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/1/1374fe7c5fa33e8003c7a1906cdf44cf26ba3ac6.png)

I want to be able to add multiple images at once, without having to add image by image (time consuming). So I was wondering if there was a way to add an action? to the plus button on the right hand side:

 ![CleanShot 2021-01-06 at 12.14.14](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/a/ad9d4e00d78d5e8e5d134763a113ff3b34d67279.png)

From which it would be possible to add multiple images at once ? Thus, creating a smart action enabling us to create multiple entries at once.

## Actual behavior

Only adding image by image.

Thanks

---

<div class="post-metadata">

**Author:** ![Guillaume\_Cisco](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/guillaume_cisco/32/918_2.png) [@Guillaume\_Cisco](https://community.forestadmin.com/u/Guillaume_Cisco)\
**Post date:** [January 6, 2021, 12:16pm UTC](https://community.forestadmin.com/t/related-data-bulk-creation/1573/2 "2021-01-06T12:16:15Z")

</div>

Hello @daweido,

It looks like your requirement can be achieved thanks to a [smart action](https://docs.forestadmin.com/documentation/reference-guide/actions/create-and-manage-smart-actions) 😃

Did you already take a look at this feature?

Let me know 🙂

---

<div class="post-metadata">

**Author:** ![daweido](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/daweido/32/1360_2.png) [@daweido](https://community.forestadmin.com/u/daweido)\
**Post date:** [January 6, 2021, 12:30pm UTC](https://community.forestadmin.com/t/related-data-bulk-creation/1573/3 "2021-01-06T12:30:09Z")

</div>

Hello @Guillaume_Cisco,

Thanks for your reply.

I actually already checked out Smart Actions but I can’t figure out how to add a smart action on related data.

Do you by any chance know how to do that?

Thanks!

---

<div class="post-metadata">

**Author:** ![Guillaume\_Cisco](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/guillaume_cisco/32/918_2.png) [@Guillaume\_Cisco](https://community.forestadmin.com/u/Guillaume_Cisco)\
**Post date:** [January 6, 2021, 12:51pm UTC](https://community.forestadmin.com/t/related-data-bulk-creation/1573/4 "2021-01-06T12:51:03Z")

</div>

Thank you for this information @daweido.

Couldn’t you directly add the smart action on your carousel collection?  
This way, you would be able to select a record in your carousel list, then click on an action entitled “add photos”.

Would that be a solution for your need?

---

<div class="post-metadata">

**Author:** ![daweido](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/daweido/32/1360_2.png) [@daweido](https://community.forestadmin.com/u/daweido)\
**Post date:** [January 6, 2021, 12:52pm UTC](https://community.forestadmin.com/t/related-data-bulk-creation/1573/5 "2021-01-06T12:52:49Z")

</div>

Thank you for your solution proposition @Guillaume_Cisco.

This could indeed be a solution, but wouldn’t that mean that the carousel HAS to be created before adding photos to it? Meaning that it would not be possible to add the photos and create the carousel in one shot?

Thanks

---

<div class="post-metadata">

**Author:** ![Guillaume\_Cisco](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/guillaume_cisco/32/918_2.png) [@Guillaume\_Cisco](https://community.forestadmin.com/u/Guillaume_Cisco)\
**Post date:** [January 6, 2021, 12:57pm UTC](https://community.forestadmin.com/t/related-data-bulk-creation/1573/6 "2021-01-06T12:57:22Z")

</div>

This is exact @daweido!

You will have to create the carousel then add photos to it. Only “single” smart action work with forms.  
The only way I can see for you to directly create a carousel and its pertained photos is to move this business code in a smart action on another collection. with a form.

Is your carousel related to any other table in your database?

---

<div class="post-metadata">

**Author:** ![daweido](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/daweido/32/1360_2.png) [@daweido](https://community.forestadmin.com/u/daweido)\
**Post date:** [January 6, 2021, 1:00pm UTC](https://community.forestadmin.com/t/related-data-bulk-creation/1573/7 "2021-01-06T13:00:16Z")

</div>

Thanks for the precisions @Guillaume_Cisco.

My carousel is indeed related to another table, other than the carouselPhotos model.

Do you think it would be possible to create a smart action to create a carousel and add photos directly?

Thanks

---

<div class="post-metadata">

**Author:** ![Guillaume\_Cisco](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/guillaume_cisco/32/918_2.png) [@Guillaume\_Cisco](https://community.forestadmin.com/u/Guillaume_Cisco)\
**Post date:** [January 6, 2021, 1:08pm UTC](https://community.forestadmin.com/t/related-data-bulk-creation/1573/8 "2021-01-06T13:08:37Z")

</div>

Yes!

I think it can be done thanks to the [form included in the smart action](https://docs.forestadmin.com/documentation/reference-guide/actions/create-and-manage-smart-actions#opening-a-form-to-ask-input-values) feature 🙂

You will be able to directly attach a carousel with its photos to a record of your other collection 🙂

---

<div class="post-metadata">

**Author:** ![daweido](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/daweido/32/1360_2.png) [@daweido](https://community.forestadmin.com/u/daweido)\
**Post date:** [January 6, 2021, 1:11pm UTC](https://community.forestadmin.com/t/related-data-bulk-creation/1573/9 "2021-01-06T13:11:07Z")

</div>

Great! Thank you very much @Guillaume_Cisco.

I will let you know if it works!

---

<div class="post-metadata">

**Author:** ![anon62739609](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@anon62739609](https://community.forestadmin.com/u/anon62739609)\
**Post date:** [January 25, 2021, 10:40am UTC](https://community.forestadmin.com/t/related-data-bulk-creation/1573/10 "2021-01-25T10:40:46Z")

</div>

Hey @daweido,

Did you make it work ?

---

<div class="post-metadata">

**Author:** ![daweido](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/daweido/32/1360_2.png) [@daweido](https://community.forestadmin.com/u/daweido)\
**Post date:** [January 25, 2021, 10:52am UTC](https://community.forestadmin.com/t/related-data-bulk-creation/1573/11 "2021-01-25T10:52:31Z")

</div>

Hey @anon62739609,

Haven’t tried yet, we have decided not to include it for the moment in our project.

Thank you.
