Brooklyn 10.0.7 JS null field issue

Chandra V
edited February 25, 2019 in Questions
We are testing Brooklyn 10.x in a sandbox and have run into a problem that is causing a lot of our pages with custom javascript to fail (which is most of our pages.)

Within the javascript, we query a field on a model and then take action based on that field having a value or not.  The fields on the object are strings, and:

if field is null, do Action 1.
if field is not null, do Action 2.

This all worked fine, but now the string fiend off the model is coming through as undefined instead of null or "".  So all our If conditions are failing to execute.

I've build a repro page off the contact object using a native string field that is probably null in most cases.

Snippet is simply this:

var params = arguments[0],
$ = skuid.$;

contactModel = skuid.model.getModel('contact');
contactRow = contactModel.getFirstRow();

var myVar = "";

// this alert will show null or ""
alert("myvar Value 1 " + myVar);

// this is a null field on the object
myVar = contactModel.getFieldValue(contactRow, 'JigsawContactId', true);

// this alert will show undefined
alert("myvar Value 2 " + myVar);

So, question - is this expected behavior and a change we need to address in all of our snippets?  I would expect the field to have a null value, not sure why it is showing up as undefined.

Full page repro:

<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" useviewportmeta="true" showheader="true">
        <model id="contact" limit="1" query="true" createrowifnonefound="false" datasource="salesforce" type="" sobject="Contact">
                <field id="Id"/>
                <field id="Name"/>
                <field id="JigsawContactId"/>
                <condition type="param" value="id" field="Id" operator="=" enclosevalueinquotes="true" novaluebehavior=""/>
        <pagetitle model="contact" uniqueid="sk-2_JDEK-150">
                <action type="multi" label="Run Snippet" uniqueid="sk-2_JDTU-153">
    <action type="custom" snippet="newSnippet"/>
        <basicfieldeditor showheader="true" showsavecancel="false" showerrorsinline="true" model="contact" buttonposition="" uniqueid="sk-2_J4uz-118" mode="readonly">
                <column width="50%">
                        <section title="Section A" collapsible="no" showheader="false">
                                <field uniqueid="sk-2_J9uF-130" id="Name" valuehalign="" type=""/>
                                <field uniqueid="sk-2_J9uF-131" id="JigsawContactId" valuehalign="" type=""/>
                <column width="50%">
                        <section title="Section B" collapsible="no" showheader="false">
            <jsitem location="inlinesnippet" name="newSnippet" cachelocation="false">var params = arguments[0],
$ = skuid.$;

contactModel = skuid.model.getModel('contact');
contactRow = contactModel.getFirstRow();

var myVar = "";

alert("myvar Value 1 " + myVar);

// this is a null field
myVar = contactModel.getFieldValue(contactRow, 'JigsawContactId', true);

alert("myvar Value 2 " + myVar);
        <styleitem type="background" bgtype="none"/>


  • Gopal Agrawal
    edited September 26, 2017
    Hi Chandra, 

    I am also facing the same issue of an undefined model.

    Please let me know, if you will get any lead regarding this.

  • Chandra V
    edited February 25, 2019
    UPDATE: Skuid dev folks are looking into this.
  • Karen Waldschmitt
    Karen Waldschmitt 🛠️ 
    edited September 28, 2017
    Hi Chandra,

    We have confirmed that our 10.0 release contained changes that include updating values from "null" to "undefined". Prior to these changes, Skuid was returning the value of things as "null" that were in fact "undefined", and this was updated to improve the stability of the product. However, this does mean that you will need to update any code you have that is relying on that value being explicitly null when there is no value. We have updated the releases notes to provide additional information about this change.

    Thank you for bringing this to our attention. If you have any further concerns, please let us know.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!