Obtain "Label" metadata property of field in renderer

  • 1
  • Problem
  • Updated 3 years ago
  • Solved
  • (Edited)
Is there a way to obtain the specified "label" property for a field from within a field renderer?

field.label and field.metadata.label contain the SFDC label (or the overridden model field value) but not the overridden label text/value from the field editor itself if applicable.

I need to be able to render the label contents in my custom renderer based on what's in the overridden value on the field in the field editor but can't seem to find it available from any property path given the "field" object in the renderer (other field level properties are available).

Possibly I'm just overlooking it.  Is this possible with the current version?

Thank you!
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,136 Points 10k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Ben Hubbard

Ben Hubbard, Employee

  • 12,530 Points 10k badge 2x thumb
Hi Barry,

field.label is the value that should have this information. This actually works correctly for the table component. I'll put this down as a bug in the field editor component. I think because of this bug, this is not currently possible without parsing the xml of the field editor component yourself. Which would be a total drag.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,168 Points 20k badge 2x thumb
Ha! I see what you did there.   Thanks for all your recent postings Barry.  We are looking into them and will respond.  You just give us such thorny problems that it takes us some time to really understand what's going on... 
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,136 Points 10k badge 2x thumb
Like that one huh?  :)  In all seriousness, the combination of all of these issues has me pretty well stuck on several fronts.  Appreciate you guys (expeditiously) reviewing and addressing.  Thanks Rob!
Photo of JD Bell

JD Bell, Senior Product Engineer

  • 3,006 Points 3k badge 2x thumb
Official Response
This issue is now resolved as of Banzai - Update 7.4, available via Skuid Releases.
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,136 Points 10k badge 2x thumb
Makes sense, thanks again Ben!
Photo of J.

J., Official Rep

  • 7,714 Points 5k badge 2x thumb
Hi, Barry. I've been working on this for the Rockaway release, and I think I've got it sorted in our dev environment (pending review now). The actual rendering of the label on the screen is still going to be the responsibility of the Component itself (no change there). We'll now send the raw value to the field renderer via the options object, i.e.:
skuid.snippet.register('customFieldRenderer',function(field,value) {
console.log(field.options.label);
});
It looks like we weren't even sending the help text value, so we'll now be sending that in the options object too (field.options.inlineHelpText). As before, field.label will still contain the text of the field's label (i.e. the merged value). This way, anyone who was depending on that merged value won't get caught off guard, but there will now be a way to get the raw value, if you need it.

We're tracking the issue of the labels not updating on model changes separately, but when we have a fix for that one, we'll let you know. Thanks again!
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,136 Points 10k badge 2x thumb
This is great J, thank you!
Photo of Ben Hubbard

Ben Hubbard, Employee

  • 12,530 Points 10k badge 2x thumb
This fix is now available from skuid.com/releases in the Rockaway Release.
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,136 Points 10k badge 2x thumb
Tested and confirmed with Skuid 8.8.  Thank you!