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 / How to restrict the Ma...
Power Apps
Answered

How to restrict the Maximum number of characters based on the Drop down choice selection

(0) ShareShare
ReportReport
Posted on by 36

Dear Team,

 

I have created a Sharepoint, in that we have field called IBAN. Based on the country the IBAN number will get changed For e.g IBAN number for Spain 20 characters, IBAN number for Germany 22 characters, IBAN number for Denmark 18 characters.

 

We have choice column DataCard as FNC. If we select FOG(Germany) in the IBAN column, the maximum characters should be 22, if we give more than 22 then the IBAN field should not allow or it should an error message. Screenshot for your better understanding. Pls help me with the condition.

IBAN.JPG

 

Thanks,

Jaleel Ahmed

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hey,
    My first thoughts were to set maximum string length in Sharepoint column. That would though only work for the countries with longest IBANs. There is option to add a validation for each column in sharepoint, however I don't have much experience there.

    Mattheus_0-1652970882524.png

    Here's a PowerApp approach you can try. If u select the text input for IBAN, there is option MaxLength. You can change the Parent.Default for any other number. Here you have few options:

    • for the FNC dropdown data source add extra column with allowed character number and point that column here
    • If there are only possible max character numbers you can try using e.g
      If( ThisItem.FNC ="FOG" || ThisItem.FNC ="FRA"||ThisItem.FNC ="POL",22, If( ThisItem.FNC ="DEN",18)) 

    Mattheus_1-1652971121000.png

    Best regards,
    Matt

  • Verified answer
    iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Hi,

     

    (Edit: forgot to include the link, added it below) I wrote an IBAN validator component a while back that you can use for this - it uses Regex and the IBAN number-conversion system to check the IBAN and the country are valid - you could take the code from this and modify it for your own needs.

     

    IBAN & SWIFT/BIC Validator - Power Platform Community (microsoft.com)

     

    Cheers,

    Sancho

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard