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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Changing field value w...
Power Pages
Answered

Changing field value when editing record

(0) ShareShare
ReportReport
Posted on by 118

Hi,


I am trying to change a fields value after a user edits the record through an edit form. This field is not a lookup field linked to a relationship, it's a simple field. This field won't be accessible or visible in this edit form. It seems like through JavaScript could be an option, running some code when the user clicks the save button, but I would like not to have to check if the form is actually going to save the record or if it's going to encounter some validation error.

 

Is there a simpler option?

 

Thanks in advance.

Categories:
  • oliver.rodrigues Profile Picture
    9,482 Most Valuable Professional on at

    if you want a static value you can use the entity form metadata: https://docs.microsoft.com/en-us/powerapps/maker/portals/configure/configure-web-form-metadata#set-value-on-save

     

    if the value is dynamic, you can set through JS 

    to add client-side validation follow this documentation: https://docs.microsoft.com/en-us/powerapps/maker/portals/configure/add-custom-javascript#additional-client-side-field-validation

  • MS5 Profile Picture
    118 on at

    Hi @OliverRodrigues ,

     

    The value is dynamic, I have tried putting this code in the custom JavaScript with no luck:

     

    $(document).ready(function() {
    $("#cr027_useremail").val(User().Email);
    });

     

    What am I doing wrong?

     

    Thanks.

  • Verified answer
    oliver.rodrigues Profile Picture
    9,482 Most Valuable Professional on at

    Hi, I am just wondering what is the User().Email in your code, is that a custom object in your JS or something?

    Can you try the following code? 

     

     

     

    $(document).ready(function() {
    
     var email = "{{ user.emailaddress1 }}";
     console.log("Email: " + email);
    
     $("#cr027_useremail").val(email);
    });

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Pages

#1
Mohsin Ali Profile Picture

Mohsin Ali 35

#2
M Bilal Khan Profile Picture

M Bilal Khan 33

#3
11manish Profile Picture

11manish 21 Super User 2026 Season 2

Last 30 days Overall leaderboard