cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SUPRIYAK
Helper III
Helper III

Disabling a gallery with a condition

I have 2 galleries.  2nd gallery (outage activities) has to be disabled till 1st gallery inputs (before outage) are filled.

SUPRIYAK_2-1643340700606.png

 

SUPRIYAK_1-1643340497289.png

 

In 2nd gallery dispalymode, I have written a code such that it is working perfectly

If(Or(First(Clc_Befout_list1).Response_1<>Blank(),First(Clc_Befout_list1).Response_2<>Blank(),First(Clc_Befout_list1).Response_3<>Blank()),DisplayMode.Edit,
Disabled)

But now requirement has come that 2nd gallery shall be enabled after all the inputs of 1st gallery are filled except time entry(HO Time). Kindly suggest what changes can be made to achieve this?

 

3 REPLIES 3
WarrenBelz
Super User
Super User

Hi @SUPRIYAK ,

I am not entirely clear on exactly what you want here, but if you are wanting to test if all the items have been completed in specific fields in a gallery (use your own names here)

With(
   {wCount:CountRows(YourGalleryName.AllItems)},
   If(
      CountRows(
         Filter(
            YourGalleryName.AllItems,
            Len(Response) > 0
         )
      ) = wCount &&
      CountRows(
         Filter(
            YourGalleryName.AllItems,
            Len('Particulars of Events') > 0
         ) 
      ) = wCount &&
	  CountRows(
         Filter(
            YourGalleryName.AllItems,
            Len(Status) > 0
         ) 
      ) = wCount,
      DisplayMode.Edit,
      DisplayMode.Disabled
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

We tried with this code, but we are getting errors.

@SUPRIYAK ,

As you would appreciate, that does not really help me. The code is valid (I tested it here) providing your list and field names are valid. Please re-check these and if still an error, post the exact code you are using (in Text) and what is showiing as an error.

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (2,642)