Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Easy? widget help

magee
Tera Guru

Objective:

Display an info message on any given catalog item that provides the average number of delivery days expected based on current catalog item AND location (reference variable on item)

 

Action taken:

1. Created a variable of type Reference which points to the location table

2. Created a variable of type Custom which points to an cloned widget. The widget is empty except for the HTML: 

<div id = "div1">
Estimated delivery:
</div>

3. Created CSS (in the widget) that display div1 as a blue box.

4. Created the script that calculates the average number of days for the given catalog based on the location selected. This script was created in a background script. Works great for what I need. This script has NOT been added to the widget.

 

What I need help with:

 

  1. On the catalog form, when the location changes, I need to pass the location AND catalog item sys_id to the server script, which will then run the calculation I need
  2. The script will return a number, for example 5
  3. I'd like 5 to display after Estimated delivery above.

Example:

Estimated delivery: 5 days

 

Here's what my catalog item page looks like now:

 

magee_0-1765310565674.png

 

I'm sure this is pretty simple and there's prob an out of the box widget i can reference, i just need a little guidance.

 

Any help is greatly appreciated-

0 REPLIES 0