How to include a column in a report that contains a URL that is dynamically generated for each row?

Wilton Wong
Tera Contributor

The ultimate goal is to include a URL on each row of a report, which the URL is dynamically generated. Here is some background information.

 

Report table: Requested Items

Report criteria: Requested Items where the Item equals a specific Catalog Item (e.g. Item A)

URL example: https://[link]?text=[Number]

[Number] in the URL is the "Number" of Requested Item structured like "RITMxxxxxxx"

 

Here are some options that I have thought of, but have no idea how I can achieve any of it.

 

Option 1: Create a URL-type variable in Item A, and have the value be calculated (or use some kind of scripts), which will put the link structure together (e.g. when a user submits a new request RITM0012345 for Item A, the value of the new URL variable for this request is https://[link]?text=RITM0012345 ). Hide this variable from the front-end (e.g. Employee Center, Service Portal, etc.) so end users will not see this field. At the end, I just need to include this variable in the report.

 

Option 2: Create a URL-type variable in Requested Item table, and have the value be calculated (or use some kind of scripts). Basically, doing the same thing as option 1, but in the Requested Item table instead. This is not preferred because the link is only needed for one Catalog Item "Item A".

 

Option 3: any other way? maybe I can just add a column in the report? I have no idea.

 

Not sure how I can achieve my goal and hopefully find some suggestions here, thanks. 

1 ACCEPTED SOLUTION

Joni V B
Tera Guru

Hi @Wilton Wong ,

 

Option 3 would be possible with a report Function field.

https://docs.servicenow.com/bundle/xanadu-now-intelligence/page/use/reporting/concept/function-field...

That way you don't need the physical field on the table.

 

Best regards,

Joni

View solution in original post

1 REPLY 1

Joni V B
Tera Guru

Hi @Wilton Wong ,

 

Option 3 would be possible with a report Function field.

https://docs.servicenow.com/bundle/xanadu-now-intelligence/page/use/reporting/concept/function-field...

That way you don't need the physical field on the table.

 

Best regards,

Joni