cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ALZamora
Level: Powered On

If function for all items in a gallery

I want my save button to appear only after all the gallery items have had their met radio button selected. My current visible formula for the save button achieves this, but only for the first gallery item. (Note: this gallery does not consist of records from a data source; once the save button is selected, it will create the records)

 

If(IsBlank(radio_metIND.selected.value), false, true)

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: If function for all items in a gallery

@ALZamora 

Set your Visible property on your button to the following:

!(Sum(yourGalleryName.AllItems, If(IsBlank(Radio_metIND.Selected.Value), 1, 0))>0)

That will do a sum of all the Radio buttons - casting them as, if blank then 1 otherwise 0. 

So, if (let's say you have 5 records) they are all blank (not selected) then the sum would be 5, which is greater then 0, thus true.  Since you want the visible property to be when that condition is NOT true, then we put a ! in the front.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

3 REPLIES 3
rajmilansinh
Level: Powered On

Re: If function for all items in a gallery

can you use if condition with "OR"( "||" )operator and write a condition for all items?

if this condition gets true then you can set button's visiblity to true.

 

Assume there is 3 items,

1. radio_metIND1

2.radio_metIND2

3. radio_metIND3

 

If(
IsBlank(radio_metIND1.Selected.Value) ||
IsBlank(radio_metIND2.Selected.Value) ||
IsBlank(radio_metIND3.Selected.Value)
,
false
, true)

So using above condition-- if anyone of the radio is not selected(Blank condition) then your button will be hide,

And if all the radio button is selected then button will be visible.

 

you can also use "AND" ("&&") operator here.

in that case using the same items your condition will be like this:

If(
!IsBlank(radio_metIND1.Selected.Value) &&
!IsBlank(radio_metIND2.Selected.Value) &&
!IsBlank(radio_metIND3.Selected.Value)
,
true
, false)

So here if all the buttons are selected(Not Blank condition) then and then only your button will be visible else it will be hidden.

Let me know if you have any query.

 

Mark this as a solution if really helps you.

 

Thanks,

Milansinh Raj

rajmilansinh
Level: Powered On

Re: If function for all items in a gallery

can you use if condition with "OR"( "||" )operator and write a condition for all items?

if this condition gets true then you can set button's visiblity to true.

 

Assume there is 3 items,

1. radio_metIND1

2.radio_metIND2

3. radio_metIND3

 

If(
IsBlank(radio_metIND1.Selected.Value) ||
IsBlank(radio_metIND2.Selected.Value) ||
IsBlank(radio_metIND3.Selected.Value)
,
false
, true)

So using above condition-- if anyone of the radio is not selected(Blank condition) then your button will be hide,

And if all the radio button is selected then button will be visible.

 

you can also use "AND" ("&&") operator here.

in that case using the same items your condition will be like this:

If(
!IsBlank(radio_metIND1.Selected.Value) &&
!IsBlank(radio_metIND2.Selected.Value) &&
!IsBlank(radio_metIND3.Selected.Value)
,
true
, false)

So here if all the buttons are selected(Not Blank condition) then and then only your button will be visible else it will be hidden.

Let me know if you have any query.

 

Mark this as a solution if really helps you.

 

Thanks,

Milansinh Raj

Super User
Super User

Re: If function for all items in a gallery

@ALZamora 

Set your Visible property on your button to the following:

!(Sum(yourGalleryName.AllItems, If(IsBlank(Radio_metIND.Selected.Value), 1, 0))>0)

That will do a sum of all the Radio buttons - casting them as, if blank then 1 otherwise 0. 

So, if (let's say you have 5 records) they are all blank (not selected) then the sum would be 5, which is greater then 0, thus true.  Since you want the visible property to be when that condition is NOT true, then we put a ! in the front.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (6,267)