cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Emont
Helper II
Helper II

Code not working

Hello,

 

I'm trying to assign a value to validarinfo, the idea is that I have a Gallery and I am trying to validate in all lines if it has blanks but is always equal to zero (either is empty the gallery or not):

 

Set(
    validarinfo,
    If(
        CountRows(
            Filter(
                Gallery3_1.AllItems,
                COLLQUANTITYTYPEOFSERVICE = "" || COLLCAPACITYSERVICEDESCRIPTION = "" || COLLUNITOFMEASURESERVICEDESCRIPTION = ""
            )
        ) = 0,
        true,
        false
    )
);

 

What is wrong with the code?

 

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
leyburn19
Memorable Member
Memorable Member

try 

COLLQUANTITYTYPEOFSERVICE = Blank() || COLLCAPACITYSERVICEDESCRIPTION = Blank() || COLLUNITOFMEASURESERVICEDESCRIPTION = Blank()

 

View solution in original post

2 REPLIES 2
leyburn19
Memorable Member
Memorable Member

try 

COLLQUANTITYTYPEOFSERVICE = Blank() || COLLCAPACITYSERVICEDESCRIPTION = Blank() || COLLUNITOFMEASURESERVICEDESCRIPTION = Blank()

 

v-chenzhi
Community Support
Community Support

Hi @Emont ,

 

Do you want to check if the item in the Gallery is empty?

Could you please tell me what’s your data source and what’s the type of COLLQUANTITYTYPEOFSERVICE and other columns?

I assume that you have this in SP and made a test on my side, please try the following workaround.

vzhichen_0-1634886685230.png

Set the OnSelect property of Button as following:

 

Set(
    validarinfo,
    If(
        CountRows(
            Filter(
                Gallery6.AllItems,
                COLLQUANTITYTYPEOFSERVICE.Value = Blank() || COLLCAPACITYSERVICEDESCRIPTION = Blank() || COLLUNITOFMEASURESERVICEDESCRIPTION = Blank()
            )
        ) = 0,
        true,
        false
    )
)

 

vzhichen_1-1634886685231.jpeg    vzhichen_2-1634886685232.jpeg

 

Best regards,

Zhi Chen

Helpful resources

Announcements
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.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (3,747)