Both keys and values should be available as tokens for grid components.

Comments

liam morland’s picture

Version: 7.x-1.x-dev » 7.x-4.x-dev
liam morland’s picture

quicksketch’s picture

Thanks Liam. I'd be happy to see this happen in Webform's token support.

danchadwick’s picture

Issue summary: View changes

I actually thought we had this, but I don't see it in the code. Anyone want to work on a patch?

  • DanChadwick committed c852bd4 on 7.x-4.x
    Issue #1651068 by DanChadwick: Added Provide tokens for keys in grid...
  • DanChadwick committed 564f5d6 on 8.x-4.x
    Issue #1651068 by DanChadwick: Added Provide tokens for keys in grid...
danchadwick’s picture

Version: 7.x-4.x-dev » 8.x-4.x-dev
Status: Active » Fixed

This is a bit ugly. The only reasonable way I could find to implement this is to generate a faux select items for the grid question and generate the token from that. I am committing this, but I am a little concerned there may be some edge cases cause by the faux component. A little testing by the community would be awesome.

Committed to 7.x-4.x and 8.x.

For version 8.x, it might be better to defer the generation of the tokens to a method of the component.

liam morland’s picture

Thanks very much.

danchadwick’s picture

You are very much welcome. People who contribute to the issue queue deserve preferential prioritization in their requests. :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.