Skip to main content

Notifications

Community site session details

Community site session details

Session Id : DT/+WNYufrgok/ACEUX7QN
Power Apps - Building Power Apps
Answered

Entering a SSN has never been solved

Like (0) ShareShare
ReportReport
Posted on 5 Jun 2024 17:42:33 by 1,259 Super User 2025 Season 1

If anyone has a simple solution that will allow the user to enter a social security number and have it automatically add the "-" please let me know.

 

I don't believe this has ever been solved.  @mdevaney posted a solution that works for US phone numbers, but this solution is very complicated for what it does and the killer of it is it won't allow for a number that starts with a 0, which some social securities do.

 

Therefore, I'm wondering does everyone else just have the users either:

A.  Enter just the number

Or

B. Enter it as text and required them to type the hyphens.

 

I've searched and if there is a simple way to do this without sliders, timers, etc. I would LOVE to see it posted here.  The fact that PowerApps doesn't support Input masking as a property is a big miss by MS.  The fact that it hasn't been fixed is sad.

 

Thanks!

Categories:
  • subsguts Profile Picture
    1,259 Super User 2025 Season 1 on 07 Jun 2024 at 17:39:16
    Re: Entering a SSN has never been solved

    To summarize, I used some parts of all 3 solutions to come up with what I believe works with a screen that has fields on it that are populated based on what the user selects in the gallery.  I will post the final version of what I did, once it is through testing as I don't want to post until I'm 100% sure there are no issues.  Thanks again to all the contributions as this really has never been solved using just one text field (before now, IMO).  

  • EddieE Profile Picture
    4,641 Super User 2025 Season 1 on 07 Jun 2024 at 04:37:46
    Re: Entering a SSN has never been solved

    @subsguts 

    This depends on how your app works, could do it multiple ways. Would need to suit your in app processes / needs.

  • Verified answer
    WarrenBelz Profile Picture
    146,881 Most Valuable Professional on 07 Jun 2024 at 03:40:46
    Re: Entering a SSN has never been solved

    @subsguts ,

    You did not mention that the field was in a Gallery - you will need to Patch each record as you write it to the data source of the Gallery and then have the Default

    Coalesce(
     ThisItem.YourSSNFieldName,
     varSSN
    )

     

  • subsguts Profile Picture
    1,259 Super User 2025 Season 1 on 07 Jun 2024 at 02:55:30
    Re: Entering a SSN has never been solved

    @EddieE This appears to work, but I need to to be able to default it to what is stored in my record.  How would I change this to accomplish that.  the SSN is stored in gblSelectedProvider.ProviderSocialSecurityNBR.

     

    Thanks! 

  • subsguts Profile Picture
    1,259 Super User 2025 Season 1 on 07 Jun 2024 at 02:07:09
    Re: Entering a SSN has never been solved

    I'm going to try out all the solutions offered and if they all work then I'll mark all of them as solutions.  As we all know there is always more than one way to skin the PowerApps cat 🙂 lol

  • subsguts Profile Picture
    1,259 Super User 2025 Season 1 on 07 Jun 2024 at 02:02:55
    Re: Entering a SSN has never been solved

    @WarrenBelz I finally got to try this.  I used the varSSN as the Default to keep it simple to start.  I type in my SSN and when I leave the field it clears it.  I put a label above it and set it to the varSSN, which shows the SSN formatted, but I'm not sure what I did wrong so that it clears the Text Input field.

     

    Before I move to the next field:

    subsguts_0-1717725753734.png

    After I move to the next field:

    subsguts_1-1717725829358.png

    Any ideas?  Thanks

  • Verified answer
    EddieE Profile Picture
    4,641 Super User 2025 Season 1 on 06 Jun 2024 at 21:45:04
    Re: Entering a SSN has never been solved

    @subsguts 

    This video gives some further ideas

    https://www.youtube.com/watch?v=povxwFZ4yik

     

    Using it, I got this working - which isn't quite there

    // Add a TextInput
    // Format
    Text
    
    // Default
    varTempTextInput
    
    // OnChange
    UpdateContext({varTempTextInput: Text(Value(Self.Text), "0##-##-####")})
    
    

     

    This can solve the '0' issue you mention but needs some work to manage number of values entered.

     

    Hope it can help?

     

     

     

     

  • subsguts Profile Picture
    1,259 Super User 2025 Season 1 on 06 Jun 2024 at 12:55:34
    Re: Entering a SSN has never been solved

    Thanks @WarrenBelz and @leonsig93 , I'm just now waking up (different time zone :-)) to all these responses so I'm going to check it out this morning.

  • leonsig93 Profile Picture
    229 on 06 Jun 2024 at 03:30:52
    Re: Entering a SSN has never been solved

    Hey @WarrenBelz , no I'm a different user. I was writing up my post while testing how to do it and didn't notice you had already replied cause I hadn't refresh the page in a while 😅.

     

    Didn't think to add validation to make sure they only input numbers.

  • WarrenBelz Profile Picture
    146,881 Most Valuable Professional on 06 Jun 2024 at 03:28:02
    Re: Entering a SSN has never been solved

    @leonsig93 (I assume you are also @subsguts ,

    I did not bother with the MaxLength as it only triggers on 9 numeric characters (I see you have deleted the Numeric test), but yes, the Boolean Variable is another slightly different way of doing it. I am not into Modern Controls at this point, but if it works for you, that is good. I assume this is now solved ?

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 42 Most Valuable Professional

#2
mmbr1606 Profile Picture

mmbr1606 41 Super User 2025 Season 1

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 36

Overall leaderboard