Where clause is using value as column name

Backendless Version

6.0.10

Expected Behavior

I am trying to use the below block to count the number of objects in the table.
The block executes as part of a DataTable afterCreate event. Below is a simplified snippet.

Actual Behavior

However, when attempting to use this block, I get the following error:

SERVER_CODE | ERROR | [20309] Error: Column '<optionId_value>' does not exist in table 'MyTable' at new ResponseError

If I use a simple text block with the hard coded string columnName = '<optionId_value>', the block executes as expected. Additionally, if I log the result of that create text block, I see the expected where clause.

What is wrong with the block in my image? Why is the value to compare to in the where clause, being used as the column name?

Any help would be appreciated.

Make sure that the single quotes are part of the text you compose with the create text with block. The screenshot you shown generates columnName = value string, while it should be columnName = 'value'

How does one wrap the result of the Get property block in single quotes?

Hi @John_Admin

You can wrap your result like that:
Screenshot 2020-08-27 at 15.00.30

To add the additional item to the create text with block, click on gear icon and drag the item to the joint block in the popup window.

Best Regards,
Maksym

That worked great. Thanks!

You’re welcome! Happy coding with Backendless!