Populate nested components

System Information
  • 4.0.0:
  • Ubuntu 20.04.3:
  • sqlite:
  • v14.18.2:
  • 6.14.15:
  • 1.22.17:

I need to populate all the nested components.
I tried /api/resturant?populate=* but it only populate first level
I also tried /api/resturant?populate[service.client][populate]?=* but it does not populate all components

At my knowledge using the following method populate=firstLevelComponent.firstComponentChild is the only way to get the nested components in strapi v4

This does work for nested component but i am with dynamic zone and i want to populate all the nested component in the dynamic zone with images

According to the documents it should work for the dynamics too. Can you share some infos about the endpoints you trying to access?

This is a single type i created


I have dynamic zone block and inside block i have two component comp1 and comp2. In comp1 there are reptable component techComp which have image and title
This is the response i get when i hit /api/page?populate=*

The compoents inside comp1 do not get populated.
This is the response when i hit /api/page?populate[block][populate]=*

All the components get populate but not the images inside the nested components.
I just want to populate all the components, nested components, all images.
Is there any way

Try to follow in your search this syntax: /api/page?populate=block.comp1.techComp.techImage maybe you need to change some characters cause my naming could be wrong.

1 Like

Thanks bro. You made my day. :blush:

1 Like

i found a solution by using this plugin: strapi-plugin-populate-deep - npm
it works like a charm.
using strapi version: 4.1.5
Hope it works for you all. Greetings

1 Like

You can use this amazing module @encoreskytech/strapi-plugin-nested-populator

It’s very easy to use.
It will work with strapi version 5 and the version 4 as well.

Enjoy the coding!