cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Shazarul
Frequent Visitor

Need help with "Or" function.

Spoiler
 

I've been trying to play around with the function called "Or" but I am not getting it right.

My current script is this but I have more of these ThisItem.1, ThisItem.2, ThisItem.3 that needs to be check.

  With(
    {
        DDate: DateDiff(
            Today(),
            ThisItem.FO_OUT,
            Days
        )
    },
    If(
        DDate <= 30,
        LightCoral,
        DDate <= 90,
        Yellow
    )
)

 

 Essentially, if (DDate or this or this or this) is true then light coral ,etc.

Help please

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Microsoft
Microsoft

Hi @Shazarul ,

 

Could you tell me:

  • Do you want to use the or identifier in the If() function when you have more columns?

 

If my assumption is correct, I've made a test for your reference::

 

1\ This is my list LIST32.

v-xiaochen-msft_0-1607924846343.jpeg

 

v-xiaochen-msft_1-1607924846343.png

 

 

2\ Add a gallery control to test.

 

3\ Insert a label control into the gallery control and set its color property to:

With({DDate:DateDiff(Today(),ThisItem.FO_OUT,Days)},If(DDate<=30 Or ThisItem.'Test 1'<53 Or ThisItem.'Test 2'<34,LightCoral,DDate<=90,Yellow))

 

4\ The result is as follows:

v-xiaochen-msft_2-1607924846345.png

 

Best Regards,

Wearsky

View solution in original post

2 REPLIES 2
poweractivate
Super User II
Super User II

@Shazarul 

 

The Or function only returns boolean like this:

 

 

 

Set(_Var01,Or(true,false))

 

 

 

In example above, _Var01 would have the value true

 

Instead of true and false above inside the Or, you can use any formula that returns this kind of values as well inline if you want.

 

You can use like this in If statement:


 

 

Set(_Var02,If(Or(true,false),"possible","impossible"))

 

 

 

In above example, the Or will always return the true result. So in If it will always go to the first or true branch of that formula, so only "possible" is possible in the above example.

 

Makes sense?

 

Check if above helps. 

v-xiaochen-msft
Microsoft
Microsoft

Hi @Shazarul ,

 

Could you tell me:

  • Do you want to use the or identifier in the If() function when you have more columns?

 

If my assumption is correct, I've made a test for your reference::

 

1\ This is my list LIST32.

v-xiaochen-msft_0-1607924846343.jpeg

 

v-xiaochen-msft_1-1607924846343.png

 

 

2\ Add a gallery control to test.

 

3\ Insert a label control into the gallery control and set its color property to:

With({DDate:DateDiff(Today(),ThisItem.FO_OUT,Days)},If(DDate<=30 Or ThisItem.'Test 1'<53 Or ThisItem.'Test 2'<34,LightCoral,DDate<=90,Yellow))

 

4\ The result is as follows:

v-xiaochen-msft_2-1607924846345.png

 

Best Regards,

Wearsky

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

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 the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (36,203)