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

Formula simplification

Hi All

 

Is there a way i can shorten this formula before I enter all 50 datacards into it? ie. Do i need to keep putting !IsBlank every time?

 

If(And(!IsBlank(DataCardValue4), !IsBlank(DataCardValue5), !IsBlank(DataCardValue6), !IsBlank(DataCardValue7), !IsBlank(DataCardValue8)),Red , Green)

 

Thank you

 

Gaz

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Formula simplification

Hi @Gazbeer ,

Slightly shorter and got rid of some brackets, but renaming your controls might help

If(
   !IsBlank(DataCardValue4) &&
   !IsBlank(DataCardValue5) &&
   IsBlank(DataCardValue6) && 
   IsBlank(DataCardValue7) && 
   !IsBlank(DataCardValue8)
	),
   Red,
   Green
 )

 

If this post helps, then please consider Accept it as the solution to help the other members find it more. It also closes the item.

View solution in original post

4 REPLIES 4
Highlighted
Super User III
Super User III

Re: Formula simplification

Hi @Gazbeer ,

Slightly shorter and got rid of some brackets, but renaming your controls might help

If(
   !IsBlank(DataCardValue4) &&
   !IsBlank(DataCardValue5) &&
   IsBlank(DataCardValue6) && 
   IsBlank(DataCardValue7) && 
   !IsBlank(DataCardValue8)
	),
   Red,
   Green
 )

 

If this post helps, then please consider Accept it as the solution to help the other members find it more. It also closes the item.

View solution in original post

Highlighted
Super User II
Super User II

Re: Formula simplification

@Gazbeer 

You could try adding a hidden label that concatenates these data card values together, then instead of your formula use something like:

 

If( !IsBlank(Label1), Red, Green)

Highlighted
Helper II
Helper II

Re: Formula simplification

Thank you, could you explain what the && mean? I also see people using || , Thank you

 

Gaz

Highlighted
Super User III
Super User III

Re: Formula simplification

Hi @Gazbeer and thank you @Eelman ,

Hidden labels do certainly perform the function required, but I find too many slow the page loading as it is another control.

To your question

&& means And

|| means Or

Saves brackets and makes complex formulas much easier to write.

So

And(a=b,c=d)  is   a=b && c=d

Or(a=b,c=d)  is   a=b || c=d

 

 

If this post helps, then please consider Accept it as the solution to help the other members find it more. It also closes the item.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,429)