Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Suggested answer

Need help with the below form

(0) ShareShare
ReportReport
Posted on by 200

Need the below details to be prepopulated with logged in user details. Any solutions or ideas please?

event-populate-requirement.png

Thanks

  • Suggested answer
    ShravanSuri Profile Picture
    ShravanSuri 1,255 on at
    RE: Need help with the below form

    Hey Swathi,

    Currently, customization using code is the only way to pre-fill this form, as Clofly points out below. Have you tried the steps she mentioned - do they work for you?

    Thanks

  • cloflyMao Profile Picture
    cloflyMao 25,202 on at
    RE: Need help with the below form

    Hi Swathi,

    You could build an entity list, set contact as its source entity,

    and Enable Entity Permissions to make sure that only logged user could retrieve his/her own data via the Odata Feed link.

    3568.JPG

    0207.JPG

    Then request the endpoint on Event registration page with code below and populate the form from retrieved result:

      var req = new XMLHttpRequest();
      req.open("GET", Url + "/_odata/openContacts", true);
      req.setRequestHeader("Accept", "application/json");
      req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
      req.setRequestHeader("Prefer", "odata.include-annotations=\"*\"");
      req.onreadystatechange = function() {
        if (this.readyState === 4) {
          req.onreadystatechange = null;
       if (this.status === 200) {
          var results = JSON.parse(this.response);
              for (var i = 0; i < results.value.length; i++) {
                    var firstname = results.value[i]["fullname"].split(" ")[0];
                    var lastname = results.value[i]["fullname"].split(" ")[1];
                    var email = results.value[i]["emailaddress1"];
                  }
         } else {
                   console.log(this.statusText);
            }
          }
        };
      req.send();

    Regards,

    Clofly

  • Fariha Asmat Profile Picture
    Fariha Asmat 216 on at
    RE: Need help with the below form

    Hi Swathi,

    You can run a workflow on the load of form, which will populate these fields with logged in user name and email id.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,817 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans