cancel
Showing results for
Did you mean:
Responsive Resident

## How to use And/Or

How can I perform an And/or check behind a button

This one works fine

If(Value(Blood1.Text) >= 120 && Value(Blood1.Text) <=129  && Value(Blood2.Text) < 80 ,Set(colorset,"#ffff1a");Set(txtval,"ELEVATED"));

But what if I want to check two text box values using an and/or calculation?
If textbox1 > 80 and/Or  textbox2 > 120

Thanks
1 ACCEPTED SOLUTION

Accepted Solutions
Community Champion

I know what the issue is... I needed to invert the order displayed on the chart when coding it, lol.

``````If(
Value(Blood1.Text) > 180 Or Value(Blood2.Text) > 120,
Red,
Value(Blood1.Text) >=140 Or Value(Blood2.Text) >= 90,
RedOrange,
(Value(Blood1.Text) >= 130 Value(Blood1.Text) <= 139) And (Value(Blood2.Text) >= 80 Value(Blood2.Text) <= 89),
Orange,
(Value(Blood1.Text) >= 120 Value(Blood1.Text) <= 129) And Value(Blood2.Text) < 80,
Yellow,
Value(Blood1.Text) < 120 And Value(Blood2.Text) < 80,
Green
)``````

13 REPLIES 13
Community Champion

If(Value(Blood1.Text) >= 120 Or Value(Textbox2.Text) > 120&& Value(Blood1.Text) <=129  && Value(Blood2.Text) < 80 Or Value(Textbox1.Text) > 80,Set(colorset,"#ffff1a");Set(txtval,"ELEVATED"));

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Community Champion

@sienna28
Can you please clarify what you want to do with this code?  I don't understand having both the AND and the OR.

If textbox1 > 80 and/Or  textbox2 > 120

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Responsive Resident

It just needs to work for these values

If textbox1 > 80 and/Or  textbox2 > 120

Community Champion
@sienna28
I guess what i am asking here is do you want the condition to be AND or OR for your code above: it cannot be both.
Responsive Resident

If you notice the second value is where the And/Or is done

Super User

In your example, the And is irrelevant.  If either value is outside of the range, the result will be flagged. I would just go with the Or condition.

Community Champion

``````If(
Value(Blood1.Text) >= 180 Or Value(Blood2.Text) >= 120,
Set(colorset,"#ffff1a"),
Set(txtval,"ELEVATED")
)``````

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Responsive Resident

Hi

That looks like it could be it, but I am not sure how it reads.

Could you please explain that logic to me....does the 180 value come into it?

Many thanks

Responsive Resident

I've attached a better graphic which shows what I am trying to do.

Using the Or condition only in the last option triggers the one above it.

Announcements

#### Microsoft Power Up program unveils new curriculum and more

New engaging and cohesive Power Up curriculum The Microsoft Power Up Program – a self-paced upskilling program, launched in 2022 to help non-technical professionals gain marketable skills using the Microsoft Power Platform – takes learning to the next level with a cohesive video-based curriculum that spans only seven weeks. Recognizing the demand for multimedia content, we partnered with Microsoft MVPs Rory Neary and Charlie Phipps to create engaging videos that not only simplify complex concepts, but also make the learner experience more dynamic and immersive. Each course follows the same business through real-world scenarios with demos and hands-on exercises for learners to gain skills and build solutions using Power Apps, Power Automate and Power BI. This structured approach not only enhances comprehension but also equips learners with tangible skills that can be applied immediately in their professional endeavors. By focusing on key areas, the program has been shortened from 12 weeks to seven, saving valuable time without sacrificing quality. Special thanks go to Microsoft Power Platform advocates, April Dunnam and Renee Noble who shared their expertise and to Power Up Program champs who contributed with feedback and reviews over the last 1+ year to make this significant improvement.   Easy access to a comprehensive Development Environment In addition, the program now offers simplified and instant access to a comprehensive development environment for Power Up Program learners to explore and experiment with the Power Platform in a sandbox environment, fostering creativity and innovation.     Introducing App-In-A-Day (AIAD) workshops for Power Up learners As an added incentive, participants of the Microsoft Power Up Program can now sign up for partner-led “App in a Day” virtual workshops. These workshops, conducted by industry experts and Microsoft partners, provide invaluable insights and practical guidance to supplement the core curriculum. By attending these workshops, learners can gain deeper insights into application development and further enhance their skills in leveraging the Power Platform for business solutions. A big shout to our partners that are supporting the Power Up Program and delivering these AIAD workshops: Advaiya, Almato AG, Braintree, Kaispe, Koenig Solutions, PowerApps 911, Pragmatic Works, Smart Consulting.   These enhancements introduced to the Microsoft Power Up Program mark a significant milestone in the ongoing quest to empower individuals with the skills needed to thrive in today’s digital economy. By embracing video-based learning, streamlining the curriculum, and offering personalized experiences, the program continues to set new standards of excellence in virtual education. Sign up today to start your Power Up learning journey (https://aka.ms/PowerUp/)   by Dimpi Gandhi, Principal PM Lead, Power Up ProgramRepost from Microsoft Power Platform Product Blog

#### Announcing Power Apps Copilot Cookbook Gallery

We are excited to share that the all-new Copilot Cookbook Gallery for Power Apps is now available in the Power Apps Community, full of tips and tricks on how to best use Microsoft Copilot as you develop and create in Power Apps. The new Copilot Cookbook is your go-to resource when you need inspiration--or when you're stuck--and aren't sure how to best partner with Copilot while creating apps.   Whether you're looking for the best prompts or just want to know about responsible AI use, visit Copilot Cookbook for regular updates you can rely on--while also serving up some of your greatest tips and tricks for the Community. Our team will be reviewing posts using the new "Copilot" label to ensure we highlight and amplify the most relevant and recent content, so you're assured of high-quality content every time you visit. If you share a post that gets featured in the curated gallery, you'll get a PM in the Community to let you know!The curated gallery is ready for you to experience now, so visit the new Copilot Cookbook for Power Apps today: Copilot Cookbook - Power Platform Community. We can't wait to see what you "cook" up!