Skip to main content
Nintex Community Menu Bar

Unable to get Datalabel value in JS script.

  • June 11, 2018
  • 3 replies
  • 106 views

Hi,

 

I have a datalabel on my form, setting a number onChange of the checkbox. Want to get this value in the Javascript.

code is like below :

<script>  debugger;    var checkboxIds = [  '53f429d8-78*personal details removed*c58-f3da-09d85cf1348f_1bf76e33-e6f2-4d1f-ae*personal details removed*f29cc4c55',  '1fa2144e-c0*personal details removed*a4c-bebe-30e241ea327f_f078efd1-77f0-59*personal details removed*a-c41c7294ce33_CheckBox',  '1050529c-68*personal details removed*-ab*personal details removed*a3caada80_f078efd1-77f0-59*personal details removed*a-c41c7294ce33_CheckBox'      ];    hideAllCheckBoxes();    function hideAllCheckBoxes() {                //This datalable value I neeed        var $selectionStartDataLable = GetSFControl('dlblCheckedCheckBoxName');        var CheckBoxNumber = $selectionStartDataLable.SFCLabel.Value; //here getting Exception        var exceptionId = checkboxIds[CheckBoxNumber].text;        if (exceptionId) {                   for (var i = 0; i < checkboxIds.length; ++i) {                if (("#" + checkboxIds) == exceptionId) {                    continue;                }                $("#" + checkboxIds).hide();            }        } else {            for (var i = 0; i < checkboxIds.length; ++i) {                $("#" + checkboxIds).show();            }        }    }    function GetSFControlID(ControlName)    { var MyControl = GetSFControl(ControlName);         return MyControl.getAttribute('ID')    }    function GetSFControl(ControlName)     {         var myTextBoxXPath = 'Controllers/Controller/Controls/Control[@Name="' + ControlName + '"]';        var windowToUse = window;         if (!checkExists(windowToUse.viewControllerDefinition))        {             windowToUse.viewControllerDefinition = $xml(windowToUse.__runtimeControllersDefinition);         }         var myControl = windowToUse.$sn(windowToUse.viewControllerDefinition, myTextBoxXPath);        return myControl    }     </script>

3 replies

Forum|alt.badge.img+8
  • June 14, 2018

Hi Shubh,


  


The best would be to contact your Customer Account Manager, and ask them to direct you to the Professional Services team for further assistance.


 


Hope this helps. 


Albarghouthy
Forum|alt.badge.img+16

Hi,


 


I usually use the following to get a Data label value


 


var dlValue = $('[name = "Data Label"]').html();

Forum|alt.badge.img+10
  • June 20, 2018
function GetSFControl(ControlName) {
var myTextBoxXPath = 'Controllers/Controller/Controls/Control[@Name="' + ControlName + '"]';
var windowToUse = window;
if (!checkExists(windowToUse.viewControllerDefinition)) {
windowToUse.viewControllerDefinition = $xml(windowToUse.__runtimeControllersDefinition);
}
var myControl = windowToUse.$sn(windowToUse.viewControllerDefinition, myTextBoxXPath);
return myControl
}

function GetSFControlID(ControlName) {
var MyControl = GetSFControl(ControlName);
return MyControl.getAttribute('ID')
}

function GetSFControlValue(ControlName) {
return $('#' + GetSFControlID(ControlName)).text();
}