merge() and mergeAsText()!

  • 2
  • Praise
  • Updated 2 years ago
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb

Posted 4 years ago

  • 2
Photo of Kvin Cloud

Kvin Cloud

  • 262 Points 250 badge 2x thumb
Hey Matt,

I know this is an old post, just wanted to see if you can give an idea.

I am trying to use a label as shown below:

var specialSegment = skuid.utils.mergeAsText("global","{{$Label.Special_Partner}}");

but have got an error saying :
skuid__SkuidJS:26 Uncaught TypeError: Cannot read property 'organizationId' of undefined

Any idea on how to utilize this method from utils ?
Photo of Kvin Cloud

Kvin Cloud

  • 262 Points 250 badge 2x thumb
I got this working.

If anyone out there is looking for same problem solution:

The reason was : The Skuid.utils.userInfo object is only available once the page is loaded.

So if you intend to access this in "inline" snippet
$(document.body).one('pageload',function(){

//Here you should be able to access as shown below
 var specialSegment = skuid.utils.mergeAsText("global","{{$Label.Special_Partner}}");    console.log('specialSegment from Label',specialSegment);

});