how to put condition on function field

Akki1
Tera Contributor

Hi,

I have a function field for which code is

glidefunction:concat(user_id, name,'(', ')', last name)

But I want it to work only when user_id is not empty because I have some brackets used here so if user_id is empty it is coming like (). So I want condition to run only if user_id is not empty

2 REPLIES 2

AnubhavRitolia
Mega Sage
Mega Sage

Hi @Akki1 

 

You can than create your own function and use it. Please refer below link for more info:

https://docs.servicenow.com/bundle/tokyo-application-development/page/app-store/dev_portal/API_refer...

 

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023

I've seen that documentation. But there is a piece I'm missing. Where do you create/run/store the GlideDBFunctionBuilder script? Inside a script include? I'm pretty sure this is obvious to everyone who knows and totally missing from the documentation for those of us who don't. I see that I can add a call to the built-in functions adding a function field to a table, but I don't think I can add the whole script there?