Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

189
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda