The documentation for mgt-search-results states that is it possible to render the entire response coming from Microsoft Graph if the data-type is set to “default”. It states that full customization of templates is possible but no detail is provided as to how you access the search results using a default template.
I would like to know how default templates can be used to access results.
I tried using various properties e.g. {{value}} to return the entire response e.g.
<mgt-search-results entity-types="driveItem" fetch-thumbnail="true" query-string="contoso">
<template data-type="default">
{{value}}
</template>
</mgt-search-results>
Some of the items worked in the mgt-dev Playground:
However once translated to an actual use case, no values are returned (when I know results exist if I remove the template e.g. use the component as it is) e.g.
<mgt-search-results
class="search-results"
query-string="ContentTypeId:0x0...* SPSiteUrl:/sites/...* Property:{{slot item @root.slots.property}}"
entity-types="driveItem"
>
<template data-type="default">
<div>{{value}}</div>
</template>
</mgt-search-results>
Yields no results (nor does it trigger error or no-data templates as there are clearly some results to show…)
Whilst setting the component to:
<mgt-search-results
class="search-results"
query-string="ContentTypeId:0x0...* SPSiteUrl:/sites/...* Property:{{slot item @root.slots.property}}"
entity-types="driveItem"
>
</mgt-search-results>
Yields results:
I was expecting to be able to use {{}} expressions to access the results.