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 :
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:
I have the same question (0)
  • oliver.rodrigues Profile Picture
    9,368 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,368 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 78 Super User 2025 Season 2

#2
Jerry-IN Profile Picture

Jerry-IN 75

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard