web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

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

Access input element that underlies the control

(0) ShareShare
ReportReport
Posted on by 8

I am using Microsoft Dynamics 365 Sales Online and I want to get DOM element from XRM.Page object using JavaScript. So, how can I get access to input that is underlies the control (or attribute) element got from Xrm.Page.getContext("any name") or Xrm.Page.getAttribute("any name"). Thank you for the hints in advance!

I have the same question (0)
  • Suggested answer
    Abdul Wahab Profile Picture
    12,119 Moderator on at

    Hi Alexander.Zaporozhets,

    Is this what you are looking for? formContext.getAttribute("name").getValue();. For more details read it out: Tutorial: Write your first client script in model-driven apps - Power Apps | Microsoft Learn.

    If I answer your question then please mark it as verified.

    Let me know if I can provide you with more details.

    Thanks
    Regards,

    Abdul Wahab
    Power Platform & Customer Engagement Developer/Lead/Solution Architecture/Project Manager
    Direct/WhatsApp:+923323281237
    E-mail: abdulwahabubit@outlook.com
    Skype: abdul.wahabubit
    Linkedin: www.linkedin.com/.../

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Alexander.Zaporozhets,

    Abdul Wahab’s answer is correct, just add more details.

     Xrm.Page is deprecated(Although it can still work by now, but it's not recommended to use it ), please use formContext instead. So you should use formContext.getAttribute("[column logical name]").getValue to get field value and  formContext.getControl("[column logical name]") to get element control.

    You can find column logical name here:

    pastedimage1665458140272v1.png

    Reference:

    Client API Reference for model-driven apps - Power Apps | Microsoft Learn

    attribute.getValue (Client API reference) - Power Apps | Microsoft Learn

    Controls in model-driven apps for Dynamics 365 - Power Apps | Microsoft Learn

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

News and Announcements

Season of Giving Solutions is Here!

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
Pallavi Phade Profile Picture

Pallavi Phade 98

#2
Tom_Gioielli Profile Picture

Tom_Gioielli 79 Super User 2025 Season 2

#3
TAHER Mehdi Profile Picture

TAHER Mehdi 48

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans