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 / Enabling a button when...
Power Apps
Unanswered

Enabling a button when all the required fields are filled

(0) ShareShare
ReportReport
Posted on by 38

Hello Everyone ! I have a canvas app where I have kept some fields as required or mandatory and some fields are not mandatory. As per the requirement there is a finish button which needs to be enabled when all the required fields are filled. 
I am using this function but no luck :
If(
IsEmpty(
Filter(
colRequiredInTransportSet,
IsBlank(QR_Code) || IsBlank(SAP_Mat_No) || IsBlank(Item_SN) || IsBlank(Manufacturer_Short)
)
),
DisplayMode.Edit,
DisplayMode.Disabled
)

In this colRequiredInTransportSet I have this info :
ClearCollect(
colRequiredInTransportSet,
Filter(
'Log.t_Transport_Set',
Required = true
)
);
Any and every help is appreciated. Thanks !!!!

Categories:
I have the same question (0)
  • cha_cha Profile Picture
    4,932 Moderator on at

    Hello @ZeroEight 

     

    You can modify your formula to use the CountRows and Filter functions together to check if all required fields are filled:

    If( CountRows( 
    		Filter( 
    			colRequiredInTransportSet, 
    			IsBlank(QR_Code) Or 
    			IsBlank(SAP_Mat_No) Or 
    			IsBlank(Item_SN) Or 
    			IsBlank(Manufacturer_Short) 
    		) 
    	) = 0, 
    	DisplayMode.Edit, 
    	DisplayMode.Disabled 
    )

    This formula will count the number of records in the colRequiredInTransportSet collection that have at least one blank field. If the count is zero, then all required fields are filled, and the finish button will be enabled. Otherwise, the button will be disabled.

     

    I hope this helps! Let me know if you have any further questions.

  • ZeroEight Profile Picture
    38 on at

    Hi @cha_cha - Still no luck , I have applied this function on display mode.

  • cha_cha Profile Picture
    4,932 Moderator on at

    Hello @ZeroEight 

     

    Maybe start with a Label first and add this code to its Text property. Let's see if it's counting properly. 

    CountRows( 
    		Filter( 
    			colRequiredInTransportSet, 
    			IsBlank(QR_Code) Or 
    			IsBlank(SAP_Mat_No) Or 
    			IsBlank(Item_SN) Or 
    			IsBlank(Manufacturer_Short) 
    		) 
    	)

     Can you please confirm what type of controls the following are as we maybe using a wrong function to check the its content:

    • QR_Code
    • SAP_Mat_No
    • Item_SN
    • Manufacturer_Short

     

  • ZeroEight Profile Picture
    38 on at

    Hi @cha_cha : 

    Can you please confirm what type of controls the following are as we maybe using a wrong function to check the its content:

    • QR_Code : Text
    • SAP_Mat_No : Text
    • Item_SN : Text
    • Manufacturer_Short : Text

      When I applied this in the text property it is counting as 31 rows. I have attached the screenshot.
  • cha_cha Profile Picture
    4,932 Moderator on at

    Hi @ZeroEight 

     

    We are unto something but will need to figure it out step by step as I don't have access to your dev environment directly.

     

    Can you please confirm that in the picture below, I am pointing a gallery control and it is possible that this gallery will show multiple rows of data?

    cha_cha_0-1679034780668.png

     

    Also,  please send screenshot of the button that you intend to show/hide when the required fields are filled or not.

     

  • ZeroEight Profile Picture
    38 on at

    Hi @cha_cha : I thank you very much for your time and effort to help me into this.  Below are the details :

    Can you please confirm that in the picture below, I am pointing a gallery control and it is possible that this gallery will show multiple rows of data? Yes , I have attached the other screen shot.

  • ZeroEight Profile Picture
    38 on at

    The button which needs to be enabled is FINISH COMPONENT button. All the frames in red are required/mandatory field. After the successful entry in those red highlighted frames. Finish component needs to be enabled.

  • cha_cha Profile Picture
    4,932 Moderator on at

    Hello @ZeroEight 

     

    Additional question, I am presuming that the ones I'm pointing with Red Arrow are the ones required. and the ones black are left empty, am I correct?

     

    cha_cha_0-1679035614610.png

     

    Presumably that we figure out how to Enable/Disable the button, may I know how do you intend to update the data? What happens when that button is clicked? I'm asking this cause I have a workaround for your requirement about the button but this might break the code that you have for your Finish component button.

  • ZeroEight Profile Picture
    38 on at

    Hi @cha_cha : As if now on the finish component button we have not applied any code. As per the functionality wise once all the required fields are populated/filled the finish component should enable. Once enabled we just need to patch status of the record from In progress to done. Hence once all the required values are filled we just need to update the status of that record to a table.

  • ZeroEight Profile Picture
    38 on at

    One more info to be clear , As per the above screenshot which you highlighted the red frames till that point we are updating patching the data. hence we dont have to do much on finish component button. Just to update the status we need that button.

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