Try Now
More in this section

Forums / Developing with Sitefinity / How to query related data through API

How to query related data through API

2 posts, 0 answered
  1. DevDev
    DevDev avatar
    2 posts
    09 Dec 2013
    26 May 2014
    Link to this post

    I have 2 dynamic modules that I created in Sitefinity 7 using the dynamic module builder- movies and actors. These dynamic types are related through module builders "RelatedData" field.

    A "Movie (Dynamic Type)" has a "Related Data" field to the "Actors (Dynamic Type)".  I also have a number of other related data types for a movie.

    I am building an MVC widget that needs to display the related "Actor (Dynamic Type)" actors for the specified "Movie" page that the user is on.

    How can I retrieve the related "Actors" for the movie? I would like to do this programatically with c# code.  I am not familiar with how to use  the "RelatedDataService" via the REST services.

    A code sample would be helpful. I've already read www.sitefinity.com/documentationarticles/related-data-field.

  2. Nikola Zagorchev
    Nikola Zagorchev avatar
    424 posts
    25 Oct 2016
    27 May 2014
    Link to this post
    Hello Aaron,

    We have answered you with details in the support ticket.
    You can query the related data items, which are items built with the module builder, as well this way:
    Then you can use GetValue() method to get the values of each of the properties for every item in the above returned collection:

    Nikola Zagorchev
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
2 posts, 0 answered