web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : bdXvK6LVTUnqpOevDCM4ji
Power Apps - Building Power Apps
Answered

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

Like (0) ShareShare
ReportReport
Posted on 19 May 2022 12:55:15 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
    on 19 May 2022 at 14:55:06
    Re: How to restrict the Maximum number of characters based on the Drop down choice selection

    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,228 Most Valuable Professional on 20 May 2022 at 14:30:22
    Re: How to restrict the Maximum number of characters based on the Drop down choice selection

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 714 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 419 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 243

Last 30 days Overall leaderboard