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 :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

How to change value of a form field to the user?

(0) ShareShare
ReportReport
Posted on by 190

I have a form and one of the fields is the requestor.  On form load, I want that field to be populated with user's name.  I have a custom user table that contains the users of the app.  So I prefer to search in this table to get the name.  I understand that this can be done with javascript.  Can someone provide some resources for doing this?  Thanks.

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    Hi bp3378,

    Yes, you could use JS to achieve this. Please follow the step:

    1. Create an onload event on your form. Reference: Dynamics CRM JavaScript OnSave and OnLoad - Carl de Souza

    2. Use retrieveMultipleRecords() method to retrieve your custom user table in your JS and then set the user lookup field. 

    Reference:

    https://docs.microsoft.com/en-us/power-apps/developer/model-driven-apps/clientapi/reference/xrm-webapi/retrievemultiplerecords

    Set and Retrieve a Lookup Id and Value using Xrm.WebApi - Carl de Souza

  • bp3378 Profile Picture
    190 on at

    thanks!

    This should be very helpful i'll take a look.  

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 > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 76

#3
Martin Dráb Profile Picture

Martin Dráb 64 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans