Skip to main content
Nintex Community Menu Bar

Unable to get Datalabel value in JS script.

  • Jun 11, 2018 2:31 PM UTC
  • 3 replies
  • 135 views
  • Translate All

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
  • Jun 14, 2018 10:17 AM UTC

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. 

Translate

Albarghouthy
Forum|alt.badge.img+16

Hi,


 


I usually use the following to get a Data label value


 


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

Forum|alt.badge.img+10
  • Jun 20, 2018 10:16 PM UTC
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();
}
Translate