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 make label visi...
Power Apps
Answered

How to make label visible true click on create button

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

I want to make Error label visible true if Textinput is blank. I have written the code below.

 

If(Isblank(txtinput.text),Errormessage1.visible=true,Errormessage1.visible=false);

 

I don't want to create context variables becasue there are many fields in my form. So, I have to create for each field one variabele. when I click on create button and I need to validate the form.

 

Categories:
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello nagamanikanta,

     

    you have to change the Visible property of your label like

     

    If(IsBlank(TextInput1),true,false)

     

    Let me know if that works. 🙂

     

    Best regards

    Vasii

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

    Hi,


    You should be able to just change the Visible property of the error message label itself:

    Change the Visible property of your error message label to:

     

    If(
        IsBlank(txtinput.text),
           true,
           false
    )

     

    Cheers,

    @iAm_ManCat

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    But I need to make label visible when i click on Create button. It needs to check whether text input is blank or not.

     

    powerApp-community.png
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Than you have to use UpdateContext({showLabel:true}) on the OnSelect property of your button and in the label visibility you should write showLabel.

     

    Best regards

    Vasii

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    If you would make required inputs or something, it would be easier to set the DisplayMode property of the button to disabled if the inputfield is blank like

     

    If(IsBlank(TextInput1),disabled,edit)

     

     

    Best regards

    Vasii

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Below code will work onselect property of create button?

    If(Isblank(txtinput.text),Errormessage1.visible=true,Errormessage1.visible=false);

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Try to use this code in the OnSelect property of your create button

    If(IsBlank(TextInput1),UpdateContext({showLabel: true}),UpdateContext({showLabel: false}))

    and insert "showLabel" in the Visible property of your errorlabel.

     

     

    Best regards

    Vasii

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    My requirement is not to create context variables(updatecontext()) to make label visible by using  this code If(Isblank(txtinput.text),Errormessage1.visible=true,Errormessage1.visible=false);  I have to make label visible

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

    You can't do that in PowerApps - you can't set another item's property directly.
    You must either use a context variable or a global variable, then set the visible property of that item to the context/global variable.

     

    The way the language and platform is designed is similar to Microsoft Excel, whereby you can't use a standard formula in one cell to directly change another cell's content.

     

    This snippet from https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/working-with-variables
    shows how variables are used as you can't directly edit properties like you can with other languages:

     

    image.png

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
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard