Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Trying to embed a HTML Web Resource on a form but struggling to pass the record ID

(1) ShareShare
ReportReport
Posted on by 75
Hi everyone, we use Retool to supplement Dynamics 365 and access Dynamics data using the Dataverse API which works fine.  If my Retool application URL is at https://domain.com/apps/Quoter?id= I can put the id of the Dynamics record ID at the end and view the id in Retool as a URL Parameter.  This works fine I want to add a button to the ribbon for example where pressing it opens the URL in a new tab and passes the id parameter.
 
However, I want to instead embed the application into a form in Dynamics, but I'm strugging on how to properly pass the record ID when doing it this way as nothing I do seems to work!  
 
The embed code Retool provides is:
 
<iframe src=https://domain.com/apps/Quoter/ width=/100%/ height=/800px/>
 
I've tried ChatGPT and Gemini and nothing seems to work.  I can display the application in my web resource no problem, but I can't seem to figure out how to pass the current record's id with the URL.
 
Thank you!
  • Dengliang Li Profile Picture
    Microsoft Employee on at
    Trying to embed a HTML Web Resource on a form but struggling to pass the record ID
    Hi,
     
    Has the issue been solved?
    Have there been any updates? Please feel free to ask me if you have any questions!
    If it has been resolved, can you mark the response as an answer?
     
  • Suggested answer
    Dengliang Li Profile Picture
    Microsoft Employee on at
    Trying to embed a HTML Web Resource on a form but struggling to pass the record ID
    Hi,
     
    In my testing, I created a web resource as follows.
    When I click the button, it passes the current record ID into the text area.
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
    </head>
    <body>
        <div><textarea id="textarea" placeholder="Shows the current record ID."></textarea></div>
        <button>click</button>
       
    </body>
    <script>
        const button = document.querySelector("button");
        const txtArea= document.getElementById("textarea");
     
        button.addEventListener("click",()=>{
            //Get Current Record GUID
            let ID = window.top.Xrm.Page.data.entity.getId();
            //Pass the ID into the text area.
            txtArea.innerText = ID;
        })
     
    </script>
    </html>
     
    Embed this web resource in the contact form.
     
     
    If my answer was helpful, please click Like, and if it solved your problem, please mark it as verified to help other community members find more.
    If you have further questions, please feel free to contact me .
     
    Best Regards,
    Dengliang Li
     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,261 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,013 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans