Skip to main content
Community site session details

Community site session details

Session Id :
Power Pages - Power Apps Portals
Answered

Add field mask – PowerApps

(0) ShareShare
ReportReport
Posted on by 312

I am working with forms in PowerApps portals, do the procedure of how to add masks to a field within an entity form in the following blog by @OliverRodrigues . And it worked pretty well.

 

http://oliverrodrigues365.com/2020/04/15/power-apps-portals-adding-field-mask

 

MartinVargas_0-1652400981637.png

 

However, implement a list for the creation of a new record with the above form. But apparently it is not taking the programming of the code in this part.

 

MartinVargas_1-1652401010612.png

 

This is the form code:

$(document).ready(function(){
 

 //DECIMAL NUMBER

 let fieldName = "crb57_decimalnumber";
 //hide initial field
 $("#" + fieldName).hide();
 //create new masked input
 let maskedInput = document.createElement("input");
 maskedInput.className = "form-control";
 maskedInput.id = "maskedInput";
 //add function to set correct value
 maskedInput.oninput = () => {
 let newValue = parseFloat($("#maskedInput").val().replace(/\D/g, ''), 10)/100;
 console.log(newValue);
 $("#" + fieldName).val(newValue);
 }
 //apply mask
 $(maskedInput).mask("###,##0.00", {reverse: true});
 //insert maskedInput after initial one
 $(maskedInput).insertAfter($("#" + fieldName));

 // WHOLE NUMBER

 let fieldName1 = "crb57_wholenumber";
 //hide initial field
 $("#" + fieldName1).hide();
 //create new masked input
 let maskedInput1 = document.createElement("input");
 maskedInput1.className = "form-control";
 maskedInput1.id = "maskedInput1";
 //add function to set correct value
 maskedInput1.oninput = () => {
 let newValue1 = parseInt($("#maskedInput1").val().replace(/\D/g, ''), 10);
 $("#" + fieldName1).val(newValue1);
 }
 //apply mask
 $(maskedInput1).mask("#,##0", {reverse: true});
 //insert maskedInput after initial one
 $(maskedInput1).insertAfter($("#" + fieldName1));

 // TEXT

 $("#crb57_text").mask("#,##0.00", {reverse: true});

 
});

 

From my perspective you need to reference the JS. But I don't know this part.

 

$(document).ready(function(){
 
	src="/jquery.mask.min.js";

 ...
});

 

Could someone help me here?

 

Thanks in advance!

  • MartinVargas Profile Picture
    312 on at
    Re: Add field mask – PowerApps

    Apparently it was just capitalizing the first letter of "code".

     

    Name: "Tracking Code"

     

    Thank you very much.

  • MartinVargas Profile Picture
    312 on at
    Re: Add field mask – PowerApps

    Hi @OliverRodrigues, I did the solution you mentioned but I still have the same problem.

     

    This is the content snippet I created

    MartinVargas_0-1652454788855.png

     

  • Verified answer
    oliver.rodrigues Profile Picture
    9,342 Most Valuable Professional on at
    Re: Add field mask – PowerApps

    hi @MartinVargas the JS reference you can do in multiple places, in my article I am giving the example as being the Web Page, you can also add the reference in a generic Content Snippet called Tracking Code

    simply create (or update) the content snippet and add the reference, this will make the mask js library be loaded on every page

     

    hope this makes sense

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Pages

#1
Lucas001 Profile Picture

Lucas001 60 Super User 2025 Season 1

#2
Fubar Profile Picture

Fubar 55 Super User 2025 Season 1

#3
surya narayanan Profile Picture

surya narayanan 35