Help with a transform

I need to create my first transform.

There is an Identity Attribute coming from our HR system; PrimaryWorkAssignmentExistsRel.AssignmentIsSupervisor; that is 0 if the user is not a supervisor and Not 0 if the user is a supervisor. What I want in IdentityNow is N if they are not a supervisor and Y if they are.

Here is my transform that is not working. The Identity Attribute still contains the number. What am i doing wrong?

    {
        "id": "59f45ebc-45f9-4e20-91f0-efe87f98af7a",
        "name": "PrimaryAssignmentIsSupervisor ",
        "type": "conditional",
        "attributes": {
            "expression": "$PrimaryAssignmentIsSupervisor eq 0",
            "positiveCondition": "$True",
            "negativeCondition": "$False",
            "department": {
                "attributes": {
                    "sourceName": "GHR",
                    "attributeName": "PrimaryAssignmentIsSupervisor"
                },
                "type": "accountAttribute"
            },
            "True": {
                "attributes": {
                    "value": "N"
                },
                "type": "static"
            },
            "False": {
                "attributes": {
                    "value": "Y"
                },
                "type": "static"
            }
        },
        "internal": false
    },

Try this

{
        "id": "59f45ebc-45f9-4e20-91f0-efe87f98af7a",
        "name": "PrimaryAssignmentIsSupervisor",
        "type": "conditional",
        "attributes": {
            "expression": "$PrimaryAssignmentIsSupervisor eq 0",
            "positiveCondition": "N",
            "negativeCondition": "Y",
            "PrimaryAssignmentIsSupervisor": {
                "attributes": {
                    "sourceName": "GHR",
                    "attributeName": "PrimaryAssignmentIsSupervisor"
                },
                "type": "accountAttribute"
            }
        },
        "internal": false
    }

that worked. Thanks for the assist!

Glad that it helped, please mark that response as Solution if no other questions/concerns.

Or just do a table lookup. No need for a conditional transform at all

Ya of course, you can use a Static transform also. You should choose transform as per your requirements considering future requirements as well.

What would the table lookup be like?

the value in the HR system could be 0 or any other number. it’s not a 1 to 1 translation.

“default” : “y”,
“0”: “n”

That covers all scenarios listed in the problem statement

Lookup Transform

{
    "name": "Supervisor lookup Transform",
    "type": "lookup",
    "attributes": {
        "input": {
			"attributes": {
				"sourceName": "GHR",
                "attributeName": "PrimaryAssignmentIsSupervisor"
			},
			"type": "accountAttribute"
		},
        "table": {
            "0": "N",
			"default": "Y"
        }
    },
    "internal": false
}

Static Transform for same requirement

{
  "attributes": {
    "isSupervisor": {
      "attributes": {
        "sourceName": "GHR",
        "attributeName": "PrimaryAssignmentIsSupervisor"
      },
      "type": "accountAttribute"
    },
    "value": "#if($isSupervisor=='0')Y#{else}N#end"
  },
  "type": "static",
  "name": "Supervisor Static Transform"
}

I always have the preference that if the output is static to use table lookup.
Value is for pushing out variables.
Conditional is for binary, but is not scalable if other outputs appear later down the line

That is just me, but whatever works is fine

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.