Hide the URL link

Lucky1
Tera Guru

Hello experts,

 

I have a URL type field on a form and I am setting up the URL dynamically from the workflow.

Is there a chance like, once the user clicks on the url link, then the link has to be disappeared.

Because once the user clicks the link, the action is already performed and why to show that link again and make it clickable again and again?

 

Can you please help me

 

 

Regards,

Lucky

12 REPLIES 12

Anil Lande
Kilo Patron

Hi,

You can use client script or UI policy to check the condition and manage the visibility of your field.

There is no way to identify if the URL has been clicked or not.

You have to manage visibility based on some other field values.

 

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Ahmmed Ali
Mega Sage

Hello @Lucky1 

 

There might be some simple solution to it to include some onclick event or something, but question is on the purpose of the link and what action does that perform. It is like password reset link, which once the password is reset, the link should be removed? if yes then I would look into solution where based on application to which link is pointing, trigger an event or some API to ServiceNow only when intended action is performed, then remove the link.

 

For example, Imaging you opened the form, clicked on the link and now the link is removed from the form. but for some reason, the intended action was incomplete (there can be several reasons, example incomplete data to perform the activity, network issue) then you have lost URL as well. How you will find the URL? submit related request again? it is not good user experience.

 

Let me know if I got the use case wrong.

 

Thank you,

Ali

 

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali

Hi ALi,

 

Yes, I understood this.

Currently, as I mentioned, that link will provide the user a new Change request form.

So, I feel providing the new CR form from the link is sufficient for one time but not on everytime when they click it.

Can you kindly help me on this

 

Regards,

Lucky

Hi @Lucky1 

 

One simple solution would be to hide the field altogether and create an UI action on the form. Make the button visible only if the URL field has value. Now, in UI action script, you can create the URL field value and then redirect user to the URL using action.setRedirectURL(YOUR_URL) in UI action script, You just have to copy the URL in some variable in script, then clear the field value and update record.

 

There could be other ways, but that depends on how much value does this functionality brings with respect to the customization being done.

 

Thank you,
Ali

 

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali