web
You’re offline. This is a read only version of the page.
close
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!
I have the same question (0)
  • Suggested answer
    Dengliang Li Profile Picture
    Microsoft Employee on at
    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
     
  • Dengliang Li Profile Picture
    Microsoft Employee on at
    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?
     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 33 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans