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 Apps / String Character limit...
Power Apps
Answered

String Character limitation

(0) ShareShare
ReportReport
Posted on by 151

Hi i have a form on powerapps which is connected to sharepoint.

In that form i have field that is Single line of text which i want to apply some rules on.

 

Is it possible to create following rules on that field:

RULES:

- EITHER EXACT 11 digits of which the 7th digit is either “-“, “A” or “+” (person)
- OR EXACT 9 digits of which the 7th digit is a “-“ (corporate customer)

 

Categories:
I have the same question (0)
  • developerAJ Profile Picture
    4,763 on at

      

    You can check by using this formula.

     

    Or(
    And(
    Len(TextInput2.Text) = 11,
    !IsBlank( Match(TextInput2.Text, "^\d{6}[-A+]\d{4}$").FullMatch)
    ),
    And(
    Len(TextInput2.Text) = 9,
    !IsBlank( Match(TextInput2.Text, "^\d{6}-\d{2}$").FullMatch)
    )
    )

     

    Please click Accept as solution and Thumbs Up. if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    You can connect with me on LinkedIn

    @Wolfmeyn

  • Wolfmeyn Profile Picture
    151 on at

    Should i use this formula in "On Change" or somewhere else ? 

  • Verified answer
    developerAJ Profile Picture
    4,763 on at

    you can use this to disable the submit button of the form by check 

     

    if(Or(
    And(
    Len(TextInput2.Text) = 11,
    !IsBlank( Match(TextInput2.Text, "^\d{6}[-A+]\d{4}$").FullMatch)
    ),
    And(
    Len(TextInput2.Text) = 9,
    !IsBlank( Match(TextInput2.Text, "^\d{6}-\d{2}$").FullMatch)
    )
    ),displaymode.edit,displaymode.disabled)

     

    and also if you are using form for datacard you would have a errormessage in datacard control you can make it visible by using below formula on visible property

     

    Not(Or(
    And(
    Len(TextInput2.Text) = 11,
    !IsBlank( Match(TextInput2.Text, "^\d{6}[-A+]\d{4}$").FullMatch)
    ),
    And(
    Len(TextInput2.Text) = 9,
    !IsBlank( Match(TextInput2.Text, "^\d{6}-\d{2}$").FullMatch)
    )
    ))

     

    for error message text property you can give what you need to display if the user enter wrong format.

     

    Please click Accept as solution and Thumbs Up. if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    You can connect with me on LinkedIn

  • Wolfmeyn Profile Picture
    151 on at

    Where do i paste this formula ?? 

    if(Or(
    And(
    Len(TextInput2.Text) = 11,
    !IsBlank( Match(TextInput2.Text, "^\d{6}[-A+]\d{4}$").FullMatch)
    ),
    And(
    Len(TextInput2.Text) = 9,
    !IsBlank( Match(TextInput2.Text, "^\d{6}-\d{2}$").FullMatch)
    )
    ),displaymode.edit,displaymode.disabled)

  • developerAJ Profile Picture
    4,763 on at

    As mentioned Submit button which you are using to submit the form display mode

  • Verified answer
    Wolfmeyn Profile Picture
    151 on at

    I modified it and used it "On Change" it works thanks

     

    If(Or(
    And(
    Len(CustimerIDFI.Text) = 11,
    !IsBlank( Match(CustimerIDFI.Text, "^\d{6}[-A+]\d{4}$").FullMatch)
    ),
    And(
    Len(CustimerIDFI.Text) = 9,
    !IsBlank( Match(CustimerIDFI.Text, "^\d{6}-\d{2}$").FullMatch)
    )
    ), true, Reset(CustimerIDFI))

     

  • Wolfmeyn Profile Picture
    151 on at

    How do i change it to mix between characters and digits. So that the rule is:

    RULES:

    - EITHER EXACT 11 characters/numbers of which the 7th digit is either “-“, “A” or “+” (person)
    - OR EXACT 9 characters/numbers of which the 7th digit is a “-“ (corporate customer)

  • Wolfmeyn Profile Picture
    151 on at

    The current solution works only for numbers(123456-1234), how do i make it work for mix between numbers and letters (12345K-123K)

     

    If(Or(
    And(
    Len(CustimerIDFI.Text) = 11,
    !IsBlank( Match(CustimerIDFI.Text, "^\d{6}[-A+]\d{4}$").FullMatch)
    ),
    And(
    Len(CustimerIDFI.Text) = 9,
    !IsBlank( Match(CustimerIDFI.Text, "^\d{6}-\d{2}$").FullMatch)
    )
    ), true, Reset(CustimerIDFI))

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard