swcoleman
(Scott Coleman)
November 2, 2023, 11:58am
1
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
},
MVKR7T
(Krishna Mummadi)
November 2, 2023, 12:10pm
2
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
}
swcoleman
(Scott Coleman)
November 2, 2023, 12:58pm
3
that worked. Thanks for the assist!
MVKR7T
(Krishna Mummadi)
November 2, 2023, 1:02pm
4
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
MVKR7T
(Krishna Mummadi)
November 2, 2023, 3:32pm
6
Ya of course, you can use a Static transform also. You should choose transform as per your requirements considering future requirements as well.
swcoleman
(Scott Coleman)
November 2, 2023, 3:52pm
7
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
MVKR7T
(Krishna Mummadi)
November 2, 2023, 4:26pm
9
Lookup Transform
{
"name": "Supervisor lookup Transform",
"type": "lookup",
"attributes": {
"input": {
"attributes": {
"sourceName": "GHR",
"attributeName": "PrimaryAssignmentIsSupervisor"
},
"type": "accountAttribute"
},
"table": {
"0": "N",
"default": "Y"
}
},
"internal": false
}
MVKR7T
(Krishna Mummadi)
November 2, 2023, 4:32pm
10
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
system
(system)
Closed
January 1, 2024, 4:37pm
12
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.