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!

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.