REST API - Combining '*' and specific field populate for a dynamic zone

System Information
  • Strapi Version: 4.9.0
  • Operating System: Windows
  • Database: SQLite
  • Node Version: v18.12.0
  • NPM Version: 7.11.2

Hi,

I have a a dynamic zone with a dozen components in it. I have no issue for most of them as they don’t go that deep. But I have one now that will go one step deep with it contain media in it.

I was using plain simple “rows?populate[column1][populate]=*” to fetch all information regarding almost all components, including images.

This one is a component that contain the component images itself, called ImageStack. So the actual media are one level deeper now in this one.

I can write “populate[column1][populate]=images.media” (and it works) but now every other components field that would need to be populated are not anymore.

How can I combine both of them in one query? I felt like the “on” keyword might have been a solution by reading the doc but haven’t been able to make it work.

Appreciate the help in advance.

1 Like

I was going to post the exact same question, but Discourse found yours for me instead.

I don’t think it is possible to do this with the REST API or even GraphQL API at the moment (not sure), but I’d love to be proven wrong.

I’ve just now filed a related feature request, which was promptly merged into this feature request: Add additional glob population options | Developer Experience | Strapi

If you end up here, feel free to give that one an upvote to express your interest! :slightly_smiling_face: