Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Conner 4 posts 73 karma points
    Jan 22, 2024 @ 15:13
    Conner
    0

    Expand nested properties on nodepicker Content API

    Hi,

    For some context, I am new to umbraco. Primarily a nodejs based developer coming from Strapi - I already much prefer Umbraco having only used it for a week!

    I am having issues with expanding the properties object on my content delivery api response.

    I have Blog Article Document which is child of Blog Document. Inside the Blog Article Document, I have a node picker for Tag field so author can attach tag(s) to that specific blog article.

    I also have Global Resources Document which houses these said Blog Tags which that also contains a further nested Document Type called Tag.

    When fetching .../content/item/blog?expand=all the picked Tags are not pulling through, but the other deeply nested properties in response do show - see screenshot attached.

    Any help and/or pointers is much appreciated!

    API Response from blog fetch

  • Conner 4 posts 73 karma points
    Jan 23, 2024 @ 11:08
    Conner
    0

    Upon further inspection of the docs, it appears you can only go 1 level with related node pickers - is there any option to expand this to say 2 or 3 - appreciate it may affect query performance.

    Cheers.

  • Mahmoud Basiony 1 post 71 karma points
    Jan 31, 2024 @ 23:20
    Mahmoud Basiony
    0

    Please check docs here

    https://docs.umbraco.com/umbraco-cms/reference/content-delivery-api/property-expansion-and-limiting

    it is mentioned that you should be able to do nested expansion with syntax like the below

    expand=properties[propertyAlias[properties[nestedPropertyAlias1,nestedPropertyAlias2]]]
    
  • Conner 4 posts 73 karma points
    Feb 01, 2024 @ 16:20
    Conner
    0

    Yeah I saw you could do this, but ideally wanted to leverage expand=all as my contents contain a lot of nested pickers, so having to manually add all attributes into the url would result in a nightmare.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies