FQL query using a variable does not work

Hi

In an Evaluate block with input variables ‘content’ and ‘assetName’ (the latter set to “Core”), why does the first FQL query below work, while the second one using a variable yields null?

content[primaryEntity.name="Core"].id

content[primaryEntity.name=assetName].id

How can I get this query to work with a variable?

Output:
(2) [“ff32e03ab003”, null]

See also the flow in my public workspace: New Flow | Help | Postman API Network

Many thanks!

Have you tried using the “string” block to set the variable value instead?

Hi arlemi

Thanks for your reply. I’ve checked. It’s the same with a string block.

I tried a couple more things and couldn’t get that to work either. Looking at the docs I couldn’t find a way to do it either so I’m just assuming this isn’t something you can do in the Evaluate block. Let’s see if someone else has more info!

1 Like

Thanks, Arlemi. I’ll move this topic to the Help category, as it doesn’t seem to be a beginner’s question anymore.

Good idea! Someone suggested using:

(
    $n := assetName;
    content[primaryEntity.name=$n].id;
)

which should give you the same result as content[primaryEntity.name=assetName].id.

This works. Many thanks for your help!

1 Like

I’m having a similar issue to @adrian-g.

Output to evaluate looks like this:

When I evaluate without grabbing the id, it evaluates boolean for each payroll record.

But when I try to get the id of the record that matches $n, it returns null, and I’m not sure what’s wrong.

I figured it out. I had that extra period between “payrolls” and “[pay_date=$n].id” and that was throwing it off.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.