Workday connector date format

Which IIQ version are you inquiring about?

8.4

Hi All,

I have an identity attribute rule in IIQ where it formats the application attribute HIREDATE from the Workday direct connector. The format is coming into IIQ as MM/dd/yyyy. We need the format to be yyyy-MM-dd (this is how it is in Workday) but upon aggregation it’s set as I mentioned above. I have created an Identity Attribute rule below but it needs refining taking into account the application account attribute. Can someone advise on the syntax based on the code below or better still advise on how to get the date format per what is natively in Workday yyyy-MM-dd?

import java.text.SimpleDateFormat;
import java.util.Date;
 
// Example: Retrieve the date attribute from an identity or application account
String rawDate = identity.getAttribute("HIREDATE"); // Change attribute name as needed
 
// Ensure the date is not null or empty
if (rawDate != null && !rawDate.isEmpty()) {
    try {
        // Define the input format (MM/dd/yyyy)
        SimpleDateFormat inputFormat = new SimpleDateFormat("MM/dd/yyyy");
        // Define the desired output format (yyyy-MM-dd)
        SimpleDateFormat outputFormat = new SimpleDateFormat("yyyy-MM-dd");
 
        // Parse the date
        Date parsedDate = inputFormat.parse(rawDate);
        // Format the date to the new format
        String formattedDate = outputFormat.format(parsedDate);
 
        return formattedDate;
    } catch (Exception e) {
        return rawDate;
    }
}
 
// Return null if no valid date is found
return null;

if chatgpt tells you to do it this way, it means it’s correct :slightly_smiling_face:

PS I also had the same problem, that from soapUI I saw a format and in IIQ another one arrived, the only thing is to use a rule like you are doing

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