Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

170
Views
ServuceNow -> Header | Footer record - Send variable from Api Controller to Body HTML template widget tag

I'm trying to understand how to pass a variable from the "Client controller" field to the "Body HTML template" on a Header | Footer (sp_header_footer) record. We have a widget embedded in a lot of pages so we just created the widget and then added it like this:

HTML Body template field:

 <div>
     <widget id="widget" options='{"button_color":"#F6A700", "home_page_id":"sysid"}'></widget>
    </div>​

What I'm trying to do is, instead of passing that object into the options, I want to make it dynamic so I can get the info of those variables dynamic via server->client->HTML

Trying to do this:

HTML Body template field:

 <div>
      <widget id="widget" options='{c.options.obj}'></widget>
    </div>​

Client Controller field:

api.controller=function() {
  /* widget controller */
  var c = this;
  c.options.button_color = "#F6A700";
  c.options.obj = {
    "button_color":c.options.button_color,
    "portal_page_id": c.options.sys_id
};
};

But I can't get it to receive this information inside the widget itself, and since the widget is scope blocked, I really need to retrieve that info on this record, since it's on the Global scope. Can someone help me, please?

Best regards!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!