How to format JSON data response from a view defined by relationships to content types related by entity reference fields I have a content type event with content name of the event, event image, a relatioship to organizer another relatioship to participant and another relationship to self event that i call programs. Now I want to make a view which return me a datasource json like


{   
    date:"10/10/2017"
    event:[
        {
            img:"image",
            description:"description",
            date:"date complet",
            program:[
                {
                    title:"titre",
                    description:"description",
                    date:"",
                },
                {
                    title:"titre",
                    description:"description",
                    date:"",
                }
            ],
            organizer:[
                {
                    name:"chis",
                    description:"description"
                },
                {
                    name:"chis1",
                    description:"description"
                }
            ],
            participant:[
                {
                    name:"zina lacina",
                    titre:"consultant"
                }
            ]
        }
    ]
}


The result is grouping by the date.
Try the Views Field View module. It gives you exactly what you need. Just add a view in your view wherever you have 1:n relationships. Setup views for program, organizer and participant and add a contextual filter for the event.

The result will be one event appearing once in your view.