Lookup handlebar bug? "$ASYNCID$0$1$"

I've just encountered my first need to map values for an XML document template. After reading the help article about using lookups in handlerbar expressions I was excited to try it out. I created my lookup, updated the template, hit Preview and BOOM: Instead of the expected string "YES" I get $ASYNCID$0$1$

Here's a template snippet:

{{lookup "NS_BOOL_TO_EVT_BOOL_LOOKUP" this.0.YM_TEAM_LIFT_INNER_US}}</teamLiftInner

Here is the result:

$ASYNCID$0$0$

Here's the lookup:

I can't easily run this flow to actually create the XML file, I need to rely on the Preview. I'm not sure if this is a Preview only bug or if I'll have the same problem when the flow runs.

Anyone ever encountered this before? If so, is it a Preview issue only?

Hi @steveklett,

Lookups in handlebars do not work when previewing, which is a known issue. As a workaround, he can post the XML to a free service like https://requestbin.com to view the output. We'd love it if you could enter this as an enhancement request here, to help us we can get this prioritized. Thank you!

In case anyone else finds this thread and needs a workaround to lookup.

function onPreMap (options) {
const NS_BOOL_TO_EVT_BOOL_MAP = {
T: 'YES',
F: 'NO'
}

return options.data.map((d) => {

// Due to handlebar {{lookup}} bug we need to do our mapping here in code rather than in the
// the template.
d = d.map(x => {
x.YM_TEAM_LIFT_INNER_US = NS_BOOL_TO_EVT_BOOL_MAP[x.YM_TEAM_LIFT_INNER_US]
x.YM_TEAM_LIFT_MASTER_US = NS_BOOL_TO_EVT_BOOL_MAP[x.YM_TEAM_LIFT_MASTER_US]
return x
})

return {
data: d
}
})
}

Hi Courtney,

Thanks for the reply.
I went ahead and ran the flow to a temp FTP server we control. The resulting file has the same bug as the preview:


12
$ASYNCID$0$2$
$ASYNCID$0$3$

I'll open a support ticket, but don't have a lot of faith in that route. I'll need to script my way around this I think.

Update: Ticket #77430 submitted