Is there a way to store a HTML Snippet in Dataverse and then display in in an Model driven app?
/P
Thanks 🙂
Generally wouldn't do it in a Model Driven App - if you did you would use the supported client side scripting for the Web Resource (https://learn.microsoft.com/en-us/power-apps/developer/model-driven-apps/clientapi/reference/controls/getcontentwindow#example) which would give you xrm object in the JavaScript in your Web Resource and then you can use the WebApi to retrieve the content and then in JS add that content to the Web Resources DOM.
In Portal/PowerPages you do it by using Liquid code
{% include 'snippet' snippet_name:'the content snippet name' %}
or
{{ snippets[the_content_snippet_name] }}
Thank you
Can I ask if there is a preferred way to display HTML snippets from a REST call to a Model Driven App or to a Power Pages pages?
Technically yes, but probably not practical for most scenarios.
e.g. if you embed a Web Resource on the Form being used for your Model Driven App, then inside that Web Resource you using JavaScript/JQuery you would query the Content Snippet table to retrieve your content and then render it in the Web Resource.
oliver.rodrigues
33
Most Valuable Professional
JB-10040341-0
12
Ă–E-05091504-0
6