Hi,

I have a mapping element and a computed element.

I simply want to access the mapping elements within the computed twig element so I can assign a score of correct mappings.
I've spent some time experimenting without any success.

{{ webform_token('[webform_submission:values:tst_map]', webform_submission) }} where tst_map is the element key provides all the mappings.

data.tst_map - yields nothing?

I want to do something like :-

if data.tst_map.source.option1 maps to data.tst_map.dest.option2 then increment ++correct_count else ++failure_count

Comments

odeno created an issue. See original summary.

jrockowitz’s picture

Status: Active » Postponed (maintainer needs more info)

@odeno Tokens only return strings. You might need to write custom code to get the mapping data.

odeno’s picture

OK.
Can anything be returned from the data object?

jrockowitz’s picture

StatusFileSize
new133.54 KB

The Computed Twig elements give you access to the webform and elements. You should debug these variables to see if you can access the mapping.

jrockowitz’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)