AD integration using spoke User Creation

C_S3
Tera Contributor

Hello All, 
We are doing AD integration using spoke and we have to achieve below functionality  : 

New User should be created with first intial, last name
e.g. for Jia Singh
jsingh

if this fails because username already exists, we should try first two letters of first name, last name
jisingh 

When I'm trying to look up the user I'm getting below error :

{
    "Action Status": {
        "code": 1,
        "message": "Error:  Invalid User Name : lundefined (Process Automation.082703af87f055107701ed3e0ebb35d4; line 35)"
    }
}

 Script which I'm using for look up : 

C_S3_0-1731216703760.png

 

Any help would be appreciated . Thank you!

4 REPLIES 4

Abhay Kumar1
Giga Sage

@C_S3 It looks like you're facing an issue in your Active Directory (AD) integration with ServiceNow using the Spoke. The error message indicates that the system is trying to create a user with an invalid username (e.g., lundefined), which suggests that there may be an issue with how the username is being generated.

Ensure that firstName and lastName are both properly populated and not undefined when the script is executed. If either value is missing, the username will end up invalid (like lundefined).

Hope this will help you.

 

Hello @Abhay Kumar1 ,
We have resolved that but now getting some different error

C_S3_0-1731433208346.png

 

 

@C_S3 The issue seems to be with the generated username value, specifically lsingh. It looks like the first initial (l) was formed incorrectly, possibly from an undefined or incorrect variable. The script may be using an unintended value or handling input data improperly.

Input Validation: Ensures that firstName and lastName are not undefined or empty.

 

Hello @Abhay Kumar1 ,
 Generated username value is correct, (New User should be created with first intial, last name
e.g. for Jia Singh
jsingh)  . Still we are getting error message while trying to look up in flow