Integration- submitting request for user I want to check whether that user exits in salesforce?

Prathamesh Chav
Tera Contributor

Hi Team,

 

While submitting any role request for particular user I want to check whether that user exits in SalesForce or not and if not then it should abort submit action.

anyone knows how to achieve this using integration?

 

Thank You,

Best Regards

1 ACCEPTED SOLUTION

@Prathamesh Chav 

for this you need to contact Salesforce team and check the endpoint and what they expect i.e. user id or email so that they can search in their system

Correct

1) configure REST message with correct authentication details etc, endpoint etc

2) pass what salesforce expects i.e. user name and email

3) invoke it via GlideAjax script include use REST Message v2 and onchange will send user id or email and you can use that in your REST Message

4) The endpoint will return success or failure

5) based on that show error message in onChange client script

I hope I have provided enough guidance on the approach.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

10 REPLIES 10

Ankur Bawiskar
Tera Patron
Tera Patron

@Prathamesh Chav 

how will you check?

Are you planning to consume an API which you got from Salesforce and send the user and it will return true or false?

If you don't have API then what next?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar ,

 

They are going to provide me the api and credetials like user ID and password,

yes currect I am planning to send user and return true or false IDK exactly how to achieve this

@Prathamesh Chav 

you can have a Reference variable to sys_user.

Let user select the User and then use onChange catalog client script + GlideAjax and consume the endpoint. If the API returns present then show error message and clear the variable and make it mandatory

So the form can be submitted only if user is not present in Salesforce.

Can we trigger outbound REST using catalog client script ? 

I believe this much information is sufficient and you can take it from here based on your developer skills.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Prathamesh Chav 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader