Skip to main content

Notifications

Community site session details

Community site session details

Session Id : YpYT0nhZPuSS+Hwbcq20YV
Power Pages - Design & Build
Answered

Display HTML Snippet

Like (0) ShareShare
ReportReport
Posted on 8 Mar 2023 13:24:11 by 48

Is there a way to store a HTML Snippet in Dataverse and then display in in an Model driven app?

 

/P

 

  • PerL Profile Picture
    48 on 10 Mar 2023 at 10:08:18
    Re: Display HTML Snippet

    Thanks 🙂

  • Verified answer
    Fubar Profile Picture
    7,867 Super User 2025 Season 1 on 09 Mar 2023 at 22:13:54
    Re: Display HTML Snippet

    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] }}

     

  • PerL Profile Picture
    48 on 09 Mar 2023 at 08:17:12
    Re: Display HTML Snippet

    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?

  • Fubar Profile Picture
    7,867 Super User 2025 Season 1 on 08 Mar 2023 at 22:23:30
    Re: Display HTML Snippet

    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. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Pages - Design & Build

#1
oliver.rodrigues Profile Picture

oliver.rodrigues 33 Most Valuable Professional

#2
JB-10040341-0 Profile Picture

JB-10040341-0 12

#3
Ă–E-05091504-0 Profile Picture

Ă–E-05091504-0 6

Overall leaderboard

Featured topics