
IsaacB.81593 (Customer) asked a question.
I'm trying to map an Okta attribute value to Cornerstone. The attribute is "Organization." In Cornerstone, this attribute is an "object" type.
It appears that I can map a set of values via a JSON literal in Profile Editor, e.g., {"id":0,"name":"xxxx","typeId":2}:
But I want to do this with a stringSwitch expression, as in
String.stringSwitch(user.department, {default JSON},"accounting",{accounting JSON})
But I get "Error in evaluating expression" in Profile editor.
Is there a way to sent JSONs in the stringSwitch expression?
Thanks

Hi @IsaacB.81593 (Customer) , Thank you for reaching out to the Okta Community!
I could not find any explicit use cases for JSON use in conjunction with the attribute mappings functions and I don't have an app integration with a sample attribute of the "object" type to test with and confirm.
That being said, just to validate the syntax structure I tested a couple of things with a generic string attribute using the following:
String.stringSwitch(user.department, '{"id":0,"name":"Default","typeId":2}', "accounting", '{"id":1,"name":"Accounting","typeId":2}')
Here are the results for a test user:
>When the user's "Department" attribute is set to something like "sales" - > output is:
"{\"id\":0,\"name\":\"Default\",\"typeId\":2}"
>When the user's "Department" attribute is set to something like "accounting" - > output is:
"{\"id\":1,\"name\":\"Accounting\",\"typeId\":2}"
I'm not sure your downstream app will parse this in the expected values, though. The String.stringSwitch function's return type will be "string". You will need to test and confirm.
If my answer helped, remember to mark it as best to increase its visibility for other members of the Okta Community who might have the same questions as you.
Hope my answer helps!
--
Help others in the community by liking or hitting Select as Best if this response helped you.
Collect them all. Learn a new skill and earn a new Okta Learning badge.
Just released: More Okta Community badges just added
Hello Mihai. When I enclose the JSON in quotes, I get an error: "Invalid value data type for property 'Organization'" That's expected as I'm now sending a string for an Object type. Thank you.
Understood. I feared as much. Then it's safe to say that this is not supported.
Feel free to submit a Feature Enhancement request via Community > Okta Ideas, if it gains popularity, it might get implemented by the Product Team.
Regards.
--
Help others in the community by liking or hitting Select as Best if this response helped you.
Collect them all. Learn a new skill and earn a new Okta Learning badge.
Just released: More Okta Community badges just added