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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Custom Text Field Requ...
Power Apps
Unanswered

Custom Text Field Required Field

(0) ShareShare
ReportReport
Posted on by 41

Hi guys, I am creating an application that has text field but it was hidden until met certain condition. What I want to do is, if its not visible (the text field) I can submit the form as usual to data source, but if the text field is visible, then it will be a required field and user cannot submit the form until that field is fill up. Any suggestion to achieve this? Thank you.

p/s: I have use this formula but no luck. Even if the field is not visible, I'm still cannot submit it because it become disabled.

DisplayMode: If(And(!IsBlank(TextInput5.Text)),DisplayMode.Edit,DisplayMode.Disabled)

Categories:
I have the same question (0)
  • iAm_ManCat Profile Picture
    18,228 Most Valuable Professional on at

    Hi,

     

    Instead of DisplayMode, why don't you change the Visible setting?

     

    Visible: !IsBlank(TextInput5.Text)

     

    The same would apply for Required :

     

    Required: !IsBlank(TextInput5.Text)

    Could you try this and let me know how you get on?

     

    Cheers,

    ManCat

  • nikfikrie92 Profile Picture
    41 on at

    Thanks for the suggestion I tried it, but when it visible, I want my submit button to be disabled until the visible textfield is filled up and when it filled then I can click on the submit button.

  • iAm_ManCat Profile Picture
    18,228 Most Valuable Professional on at

    Ok, well that's also do-able - although having the conditional Required flag on the Datacard for TextInput5 will mean that you can't submit it without filling it in...

     

    So to have your Submit button be disabled until that TextInput5 is filled, set its Displaymode Property:

     

    DisplayMode: If( Len( TextInput5.Text)>0, DisplayMode.Edit, DisplayMode.Disabled)

    This checks if there's anything in the TextInput5, if yes then Submit button enabled, otherwise its disabled - if you want it to be disabled until they've typed a certain number of characters, then change the >0 to something else like >4

     

    I've attached a POC for this, hopefully you find it useful 🙂

     

    Cheers,

    ManCat

  • nikfikrie92 Profile Picture
    41 on at

    Thank you. That's work for disabling the submit button, but if the TextInput5 is not visible then I'm stuck with the button that has been disabled. I cant use Required since the field is not required. It's only become required when it's visible. If it's not visible then it's not required to be filled up.

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

    Ok, not a problem, so we change the logic of it to only be disabled when it's visible & empty?

     

     


    If(
    //If Its visible, but not filled, then disable the button
    TextInput5.Visible && Len(TextInput5.Text)=0, DisplayMode.Disabled,

    //If Its visible, and filled, then enable the button TextInput5.Visible && Len(TextInput5.Text)>0, DisplayMode.Edit,
    //If Its not visible, then enable the button DisplayMode.Edit
    )

     

     

     

    Please take a look at revised POC and adapt to your needs,

     

    Cheers,

    ManCat

  • nikfikrie92 Profile Picture
    41 on at

    Thank you so much! That solved it. Love you. Smiley Very Happy

  • iAm_ManCat Profile Picture
    18,228 Most Valuable Professional on at

    You're welcome!

     

    Hopefully you've managed to gain both a working process and more knowledge on PowerApps? We are all here to learn, I've learnt something today already by helping to solve another issue on here 🙂

     

    Cheers,

    ManCat

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard