SharePoint View Formatting - IF Null AND - json

I have an SP list, and have formatted the view with some JSON but on the 'Open' I want to also included IF open AND "people picker field null" Basically I'm want to hightlight something that is open an unassigned to someone
{
"schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
"additionalRowClass": "=if([$Status] == 'Open', 'ms-bgColor-green ms-fontColor-black', if([$Status] == 'Closed', 'ms-bgColor-magentaLight ms-fontColor-black', if([$Status] == 'On Hold - 3rd Party', 'ms-bgColor-magentaLight ms-fontColor-black', if([$Status] == 'On Hold - 3rd Party', 'ms-bgColor-neutralLighterAlt ms-fontColor-black', if([$Status] == 'On Hold - User information', 'ms-bgColor-purpleLight ms-fontColor-black', if([$Status] == 'Closed', 'ms-bgColor-magentaLight ms-fontColor-black',if([$Status] == 'Request Completed Fulfilled','ms-bgColor-teal ms-fontColor-black' ,if([$Status] == 'Cancelled','ms-bgColor-yellow ms-fontColor-black', if([$Status] == 'Rejected Atlas','ms-bgColor-orangeLight ms-fontColor-black' if([$Status] == 'Rejected iHub','ms-bgColor-neutralSecondary ms-fontColor-black', ''))"
}
Any help would be cool

=if(#currentField <= #now && [$RAG] != 'Live', '#bc1010', '')"
&& is used as the and operator. In the example above, i'm looking to see if the time is now, and if the RAG column does not equal Live.

Related

Github action job fire when previous job skipped

While setting up my GitHub action to build and deploy my apps, I'm running into the following issue.
I want to deploy my web app under the following conditions below. However, whenever deploy-api and deploy-sync skip deploy-web is also skipped. I figured that my if condition would catch that case and still run deploy-web but it isn't. Feels like I'm missing something obvious but can't identify it.
deploy-web:
name: Deploy Web
runs-on: ubuntu-latest
needs: [build-and-publish-web, deploy-api, deploy-sync]
if: |
needs.build-and-publish-web.result == 'success' &&
(needs.deploy-api.result == 'success' || needs.deploy-api.result == 'skipped') &&
(needs.deploy-sync.result == 'success' || needs.deploy-sync.result == 'skipped')
It seems like you encounter this issue - Job-level "if" condition not evaluated correctly if job in "needs" property is skipped.
Please try with always expression:
deploy-web:
name: Deploy Web
runs-on: ubuntu-latest
needs: [build-and-publish-web, deploy-api, deploy-sync]
if: |
always() &&
needs.build-and-publish-web.result == 'success' &&
(needs.deploy-api.result == 'success' || needs.deploy-api.result == 'skipped') &&
(needs.deploy-sync.result == 'success' || needs.deploy-sync.result == 'skipped')
Not specific to the original question but if all you care about is making sure there are no failures, needs.*.result provides wildcard behavior that prevents you from having to manually check each step:
if: |
always() &&
!contains(needs.*.result, 'failure') &&
!contains(needs.*.result, 'cancelled')

PhpStorm over-indenting multi-line functions

I'm currently attempting to configure PhpStorm to produce fully-PSR-2-compliant code, however its formatter is tripping up on long lines which contain functions with multiple parameters.
When I run the formatter, it converts this:
return ($thisIsALongLine || functionCall($arg1, $arg2));
into this:
return ($thisIsALongLine || functionCall(
$arg1,
$arg2
));
However, what I want is this:
return ($thisIsALongLine || functionCall(
$arg1,
$arg2
));
Does anyone know which formatter option tells it to further indent multi-line function calls in this instance?
Note: Usually, I'd format the above as this:
return ($thisIsALongLine
|| functionCall($arg1, $arg2));
However, that just bypasses the extra indentation issue, which I'd still need to fix for other situations.
Edit: This is the state of Wrapping and Braces, as requested by #LazyOne below:
Edit 2: Examples of two different types of line which PhpStorm's formatter isn't handling correctly. (Disclaimer: This is old code from a legacy system.)
Firstly, this:
if ($validateBudget && $this->getFinancialPeriodService()->validateBudget($formModel->action, $formModel->estimatedBudget, $formModel->startDate, $formModel->endDate, $formModel->isFirstPeriod)) {
becomes this:
if ($validateBudget && $this->getFinancialPeriodService()
->validateBudget($formModel->action, $formModel->estimatedBudget,
$formModel->startDate, $formModel->endDate, $formModel->isFirstPeriod)) {
when I would expect this based on the settings above:
if ($validateBudget && $this->getFinancialPeriodService()
->validateBudget(
$formModel->action,
$formModel->estimatedBudget,
$formModel->startDate,
$formModel->endDate,
$formModel->isFirstPeriod
)
) {
Secondly, if you enable alignment on chained methods, then this:
if ($evaluation->getExpert() != NULL && ($evaluation->getExpert()->getStatusId() == Evaluation::STATUS_ASSIGNED || $evaluation->getEvaluationStage() == Evaluation::STAGE_PROPOSED && CoreDateUtils::dateIsPast($proposal->getCalendar()->getStage1StartDate()) == false || $evaluation->getEvaluationStage() == Evaluation::STAGE_IN_PROGRESS && CoreDateUtils::dateIsPast($proposal->getCalendar()->getStage2StartDate()) == false)) {
is reformatted to this:
if ($evaluation->getExpert() != null && ($evaluation->getExpert()
->getStatusId() == Evaluation::STATUS_ASSIGNED || $evaluation->getEvaluationStage() == Evaluation::STAGE_PROPOSED && CoreDateUtils::dateIsPast($proposal->getCalendar()
->getStage1StartDate()) == false || $evaluation->getEvaluationStage() == Evaluation::STAGE_IN_PROGRESS && CoreDateUtils::dateIsPast($proposal->getCalendar()
->getStage2StartDate()) == false)) {
when I would expect this:
if ($evaluation->getExpert() != null
&& ($evaluation->getExpert()->getStatusId() == Evaluation::STATUS_ASSIGNED
|| $evaluation->getEvaluationStage() == Evaluation::STAGE_PROPOSED
&& CoreDateUtils::dateIsPast($proposal->getCalendar()->getStage1StartDate()) == false
|| $evaluation->getEvaluationStage() == Evaluation::STAGE_IN_PROGRESS
&& CoreDateUtils::dateIsPast($proposal->getCalendar()->getStage2StartDate()) == false)
) {
To be honest, at this point I suspect a bug in the formatter, so will open a ticket with JetBrains, however I'll leave this open in case anyone does know why it over-/underformats things.

SSIS Derived column Transformation setting to BOOL with UPPER(LTRIM(RTRIM

I have a Flag which needs to be set to 1 or 0. so i used Derived column transformation to convert it to bool
as you can se the code it works only when i use an OR operator for both Y and N .
This code below works for IF Flag is Y and N condition
(DT_BOOL)(Flag == "Y" ? 1 : 0) || (DT_BOOL)(Flag == "N" ? 0 : 1)
** working only when FLAG = (Capital)Y OR N *****************
but if my Flag is small 'n' it does not work it still sets to TRUE
I want to make it UPPER and TRIM it at the same time . Which i am having hard time to figure out .
This is my code but it does not work
(DT_BOOL)(UPPER(RTRIM(LTRIM
(Flag == "Y" ? 1 : 0)
)))
||(DT_BOOL)(UPPER(RTRIM(LTRIM(Flag == "N" ? 0 :1)
))) ***** this code is not working *****************
Thanks for your time.
PLEASE look at Tranformation Pic
Try this...
(DT_BOOL)(UPPER(RTRIM(LTRIM(Flag))) == "N" ? 0 :1)

Nested ternaries, can't spot the error

I have this nested ternary expression in SSIS that I can't seem to get to work, my eyes are about to come out of my skull.
FINDSTRING(TRIM(f3),"BASICS",1) != 0 ? (UPPER(LEFT(TRIM(f3),1)) == "F" ? #[User::FallBasicsEntityId] : (UPPER(LEFT(TRIM(f3),1)) == "S" ? #[User::SpringBasicsEntityId] : #[user::BasicsEntityId])) : (UPPER(LEFT(TRIM(f3),1)) == "F" ? #[user::FallEntityId] : (UPPER(LEFT(TRIM(f3),1)) == "S" ? #[user::SpringEntityId] : #[user::DefaultEntityId]))
Here's an "indented" version:
FINDSTRING(TRIM(f3),"BASICS",1) != 0
? (
UPPER(LEFT(TRIM(f3),1)) == "F"
? #[User::FallBasicsEntityId]
: (
UPPER(LEFT(TRIM(f3),1)) == "S"
? #[User::SpringBasicsEntityId]
: #[user::BasicsEntityId]
)
)
: (
UPPER(LEFT(TRIM(f3),1)) == "F"
? #[user::FallEntityId]
: (
UPPER(LEFT(TRIM(f3),1)) == "S"
? #[user::SpringEntityId]
: #[user::DefaultEntityId]
)
)
What am I missing? It looks to me like the parentheses are balanced and properly placed.. or are they?
I'm about to ditch this and resort to a script component... it seems to me such an expression would be easier to maintain with C# code...
The parentheses are balanced; the problem is that user is not the same as User.

SSIS Derived Column IS NOT NULL with Or expression

I need assistance writing an Derived Column expression that meets this criteria.
IF ([Name of Job] is "Accenture Leadership" OR "Senior Executive") AND [Pay scale Group] IS NOT NULL THEN [Pay scale Group] ELSE [Name of Job].
Thanks,
Try this:([Name of Job] == "Accenture Leadership" ||[Name of Job] == "Senior Executive") && ISNULL([Pay scale Group]) == FALSE ? [Pay scale Group] : [Name of Job]
reference