Placeholders don't work in Eval Populate for checkbox?

Status
Not open for further replies.

usdc-or

Member
If I put quote marks around my placeholders e.g. '{tablename___elementname}' then the eval is seeing {tablename___elementname}, rather than the value of that element. If I don't use quote marks, an error is returned because of the curly bracket.

I'm using some of these values in the query to get the checkbox options. Any advice would be appreciated.
 
Thank you; I did just see it works fine on existing data, and so was clued into the issue. A bit odd that it returned the placeholder rather than a null value, but I was able to work around it.
 
That's actually an option in the function that does the replacement. So it's always a judgement call as to which option is best in any given scenario, whether to keep the placeholders or remove them if they aren't found. In general, I tend to err towards leaving them, as it often makes it more obvious what the problem is, when you see a placeholder where you don't expect it, rather than an empty string (which could mean lots of things).

In this case, I think it's probably better to remove them. It's just never come up before - very few people use that feature, and even fewer us placeholders in it. In fact, you are the first person I can recall raising the issue.

So ... I'll go and change the code to strip them ...

-- hugh
 
Oh, BTW, did you know you can use defaults in placeholders, with a || seperator?

So {tablename___elementname||1} will default to 1 if the placeholder isn't found.

-- hugh
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top