Transform is always going to Negative Condition

Been working on a transform and it continuously goes to the negative condition. Below is my transform.

{

"id": "2b6edcf3-4f5b-43e7-89a9-6fc94474c6ee",

"name": "CR1606_MultiSource_Employee_Contractor",

"type": "conditional",

"attributes": {

    "expression": "lookup(upper(trim(accountAttribute('ARHSB-Passport Database','User_Type'))),'CONTRACTLABOR','true','CONTRACT LABOR','true','CONTRACTOR','true') eq 'true'",

    "positiveCondition": {

        "type": "lookup",

        "attributes": {

            "input": {

                "type": "split",

                "attributes": {

                    "input": {

                        "type": "firstValid",

                        "attributes": {

                            "values": \[

                                {

                                    "type": "accountAttribute",

                                    "attributes": {

                                        "sourceName": "ARHSB-Lawson-Test",

                                        "attributeName": "Process Level"

                                    }

                                },

                                {

                                    "type": "accountAttribute",

                                    "attributes": {

                                        "sourceName": "ARHSB-Passport Database",

                                        "attributeName": "ARH_Facility"

                                    }

                                }

                            \]

                        }

                    },

                    "delimiter": "-",

                    "index": 0

                }

            },

            "table": {

                "2001": "Beckley Hospital",

                "2002": "Summers County Hospital",

                "2003": "Tug Valley Hospital",

                "2004": "McDowell Hospital",

                "2005": "Hazard Regional Medical Center",

                "2007": "Whitesburg Hospital",

                "2008": "Harlan Hospital",

                "2009": "Middlesboro Hospital",

                "2010": "Morgan County Hospital",

                "2011": "Mary Breckinridge Hospital",

                "2012": "Barbourville Hospital",

                "2013": "Our Lady of the Way Hospit",

                "2014": "Highlands Regional Med Ctr",

                "2015": "Paintsville Hospital"

            },

            "default": "UNKNOWN"

        }

    },

    "negativeCondition": {

        "type": "identityAttribute",

        "attributes": {

            "name": "employeeType"

        }

    }

},

"internal": false

}

Can you please let me know which input you are trying this transform with.

Check your expression and see if it always return false ?

What i am trying to do is set the value of an identity attribute only if the employeetype is ContractLabor and taking the processlevel and looking it up in the table to get the value that I want

How would I check my expression to see if it always returns false

Explain me the logic, I will help you to write a expression for your usecase.

Hi @dpowers1

is the employeeType already ContractLabor before the transform runs?

So I have an authoritative source for all of our non-employees coming in and the User_type is a field from that source that tells us if they are non-employee or ContractLabor. I only want to set the identity attribute that I created to the value in the table matching the processlevel if they are ContractLabor user_type. The process level has to be split because it in there as like 2005 - Hazard Regional Medical.

Yes the employeeType identity attribute is set to the User_Type coming from that Passport source and it is going to be either ContractLabor, Non-employee, and many other different types

Don’t think your expression is correct. It needs to be comparing two strings (or “output” of other transforms). The expression can’t be compound transforms. The output of the other transforms need to be pre-evaluated outside of the expression itself.

have you tried removing the ‘s around the ‘true’? It appears that you are trying to match “true eq ‘true’”, which would always fail.

It is still resulting to the negativecondition when the user_type is ContractLabor

@dpowers1 Can you test bellow transform please?

{
  "name": "CR1606_MultiSource_Employee_Contractor", 
   "type": "conditional", 
   "attributes": {
      "expression": "$isContractor eq true",

      "isContractor": {
         "type": "lookup",
         "attributes": {
            "input": {
              "type": "upper", 
              "attributes": {
                "input": { 
                  "type": "trim", 
                  "attributes": {
                     "input": { 
                       "type": "identityAttribute", 
                       "attributes": { 
                         "name": "employeeType" 
                        } 
                      } 
                    } 
                  } 
                } 
              }, 
              "table": { 
                 "CONTRACTLABOR": "true",
                 "CONTRACT LABOR": "true", 
                 "CONTRACTOR": "true",
                 "default": "false" 
              } 
            } 
          }, 
       
          "positiveCondition": { 
             "type": "lookup", 
             "attributes": { 
                "input": {
                   "type": "split", 
                   "attributes": { 
                      "input": { 
                         "type": "firstValid", 
                         "attributes": { 
                            "values": [ 
                              { 
                                "type": "accountAttribute", 
                                "attributes": { 
                                   "sourceName": "ARHSB-Lawson-Test",
                                   "attributeName": "Process Level"
                              }
                            }, 
                            {
                                 "type": "accountAttribute", 
                                 "attributes": { 
                                    "sourceName": "ARHSB-Passport Database",
                                    "attributeName": "ARH_Facility" 
                             } 
                           } 
                         ] 
                        } 
                      },
                      "delimiter": "-",
                      "index": 0 
                     }
                   }, 
                   "table": { 
                      "2001": "Beckley Hospital", 
                      "2002": "Summers County Hospital", 
                      "2003": "Tug Valley Hospital", 
                      "2004": "McDowell Hospital", 
                      "2005": "Hazard Regional Medical Center", 
                      "2007": "Whitesburg Hospital", 
                      "2008": "Harlan Hospital", 
                      "2009": "Middlesboro Hospital", 
                      "2010": "Morgan County Hospital", 
                      "2011": "Mary Breckinridge Hospital", 
                      "2012": "Barbourville Hospital", 
                      "2013": "Our Lady of the Way Hospit", 
                      "2014": "Highlands Regional Med Ctr", 
                      "2015": "Paintsville Hospital", 
                      "default": "UNKNOWN"
                     }
                   } 
                 }, 

                 "negativeCondition": { 
                    "type": "identityAttribute", 
                    "attributes": { 
                       "name": "employeeType" 
                     } 
                   } 
                 }, 
                 "internal": false 
}


Shawn that worked for me, can you help me understand what I was doing wrong in the other

Surprised the “Expert” Ambassador didn’t point out the issue with the expression.

Refer to this for examples of how the conditional Transform ought to be structured:

@dpowers1 , also, try to use the ISC VS Code extension if you can (if you’re not already doing so). It helps with the JSON structure of transforms to some extent.

Glad it worked.

The expression was trying to run inline which isn’t supported, so I moved the contractor check into a named variable isContractor and referenced it in the expression as $isContractor eq true. Also, added upper and trim to case sensitivity, and moved default inside the table. Positive condition for the hospital mapping, negative condition returns employeeType as is.

Thanks

This is really interesting. Is this something SailPoint has introduced new? Where did you find this? Could you share the documentation link?

@iamnithesh the one who posted was using this. I tried some modification in it. I don’t think it will work like this.

I was also trying something new after checking this expression.

@dpowers1
Could you please mark my answer above as the solution instead? That way, others can more easily find the actual fix.

Thanks