I have an Object and related Details View that has a short text field that contains a hex color code (#ff0000). I am trying to pass that value in a Scene over to a CSS override to change the font colors on the page. When I hard code the color in javascript it works but when I create a variable to read the field value I am not getting anything. I have a multi-tenant app and I want the Organizations to choose their own color codes to match their logos. This code works:
$(document).on('knack-scene-render.scene_305', function(event, scene) {
var current_Color = "#ff0000";
$('h3').css('color', ''+current_Color+'','!important');
});
I need to change
var current_Color = "#ff0000";
to
var current_Color = "FieldTextValue";
The FieldTextValue is a hex code like #ff0000 - short text field in the object
Tried a few things, this one seems to be populating the H3 but with empty data:
var current_Color = $('#view_2401.field_3133 .kn-value').text();