Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Workday - email writeback - Dynamic Worker_Reference

Houssem93
New Contributor
New Contributor

Hello,

 

I configurated a Workday connector (Workday_Hybrid_OAUTH(Workday)) to write back the email to Workday.

The following UPDATE_USER_PAYLOAD is working fine for "Internals":

<bsvc:Change_Work_Contact_Information_Request
xmlns:bsvc="urn:com.workday/bsvc"
bsvc:version="${API_VERSION}">
<bsvc:Business_Process_Parameters>
<bsvc:Auto_Complete>true</bsvc:Auto_Complete>
<bsvc:Run_Now>true</bsvc:Run_Now>
<bsvc:Discard_On_Exit_Validation_Error>true</bsvc:Discard_On_Exit_Validation_Error>
</bsvc:Business_Process_Parameters>
<bsvc:Change_Work_Contact_Information_Data>
<bsvc:Person_Reference>
<bsvc:ID bsvc:type="Employee_ID">${user.employeeid}</bsvc:ID>
</bsvc:Person_Reference>
<bsvc:Event_Effective_Date>${CURRENT_PROV_TIMESTAMP}</bsvc:Event_Effective_Date>
<bsvc:Person_Contact_Information_Data>
<bsvc:Person_Email_Information_Data bsvc:Replace_All="false">
<bsvc:Email_Information_Data bsvc:Delete="false">
<bsvc:Email_Data>
<bsvc:Email_Address>${user.email}</bsvc:Email_Address>
<bsvc:Email_Comment>New Email</bsvc:Email_Comment>
</bsvc:Email_Data>
<bsvc:Usage_Data bsvc:Public="true">
<bsvc:Type_Data bsvc:Primary="true">
<bsvc:Type_Reference>
<bsvc:ID bsvc:type="Communication_Usage_Type_ID">WORK</bsvc:ID>
</bsvc:Type_Reference>
</bsvc:Type_Data>
<bsvc:Comments>New Primary email</bsvc:Comments>
</bsvc:Usage_Data>
</bsvc:Email_Information_Data>
</bsvc:Person_Email_Information_Data>
</bsvc:Person_Contact_Information_Data>
</bsvc:Change_Work_Contact_Information_Data>
</bsvc:Change_Work_Contact_Information_Request>

 

I want to update the <bsvc:Person_Reference> to put type="Employee_ID" when the worker is an internal and put "Contingent_Worker_ID" when the worker is an external.

I've tried the two following syntaxes but I am always getting a SOAP validation error of my request (see the attached logs) :

1st syntax: <bsvc:Worker_Reference> <bsvc:ID bsvc:type=\"'+(user.employeetype != 'Internal'?('Contingent_Worker_ID') : 'Employee_ID')+'\">'+user?.username+'</bsvc:ID> </bsvc:Worker_Reference>

2nd syntax: <bsvc:ID bsvc:type=\"${if((user?.employeeType.contains('Internal'))){'Employee_ID'} else {'Contingent_Worker_ID'}}\">${user.employeeid}</bsvc:ID> 

 

> Can you provide me the right syntax to implement please ? 

Thanks for your help !

N.B: We are on 24.7 version but it wasn't suggested in the Product Version list.

 

2 REPLIES 2

rushikeshvartak
All-Star
All-Star

Refer https://forums.saviynt.com/t5/identity-governance/how-to-use-conditions-in-soap-connector-response-m...

 

<bsvc:Change_Work_Contact_Information_Request
xmlns:bsvc="urn:com.workday/bsvc"
bsvc:version="${API_VERSION}">
<bsvc:Business_Process_Parameters>
<bsvc:Auto_Complete>true</bsvc:Auto_Complete>
<bsvc:Run_Now>true</bsvc:Run_Now>
<bsvc:Discard_On_Exit_Validation_Error>true</bsvc:Discard_On_Exit_Validation_Error>
</bsvc:Business_Process_Parameters>
<bsvc:Change_Work_Contact_Information_Data>
<bsvc:Person_Reference>
<bsvc:ID bsvc:type="${user.employeeType == 'Internal' ? 'Employee_ID' : 'Contingent_Worker_ID'}">${user.employeeid}</bsvc:ID>
</bsvc:Person_Reference>
<bsvc:Event_Effective_Date>${CURRENT_PROV_TIMESTAMP}</bsvc:Event_Effective_Date>
<bsvc:Person_Contact_Information_Data>
<bsvc:Person_Email_Information_Data bsvc:Replace_All="false">
<bsvc:Email_Information_Data bsvc:Delete="false">
<bsvc:Email_Data>
<bsvc:Email_Address>${user.email}</bsvc:Email_Address>
<bsvc:Email_Comment>New Email</bsvc:Email_Comment>
</bsvc:Email_Data>
<bsvc:Usage_Data bsvc:Public="true">
<bsvc:Type_Data bsvc:Primary="true">
<bsvc:Type_Reference>
<bsvc:ID bsvc:type="Communication_Usage_Type_ID">WORK</bsvc:ID>
</bsvc:Type_Reference>
</bsvc:Type_Data>
<bsvc:Comments>New Primary email</bsvc:Comments>
</bsvc:Usage_Data>
</bsvc:Email_Information_Data>
</bsvc:Person_Email_Information_Data>
</bsvc:Person_Contact_Information_Data>
</bsvc:Change_Work_Contact_Information_Data>
</bsvc:Change_Work_Contact_Information_Request>


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Houssem93
New Contributor
New Contributor

It's working as expected. Thanks a lot !