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
Solved! Go to Solution.
Hi @Shazarul ,
Could you tell me:
If my assumption is correct, I've made a test for your reference::
1\ This is my list “LIST32”.
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:
Best Regards,
Wearsky
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.
Hi @Shazarul ,
Could you tell me:
If my assumption is correct, I've made a test for your reference::
1\ This is my list “LIST32”.
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:
Best Regards,
Wearsky
Refer to the post below, unable to delete this post.
DateDiff(start_date, end_date, unit). My end_date consist of my many variables, ThisItem.FO_Out, ThisItem.KMC_Out, ThisItem.Test1, ThisItem.Test2, etc.
How do I declare that many var within that DateDiff function.
Edit: I just saw an Or function inside that If function. What?!!!! Just like that and it works?!
Thanks a bunch!