https://discord.gg/botpress logo
*Hello, I'm trying to use Find Records card with v...
# 💻developers
h
Hello, I'm trying to use Find Records card with variable inside a prompt. When I hardcode prompt like "find a contacts with name or lastname is Doe" everything works well and database query constracted correctly,
Copy code
Logs:
AI Query generated successfully
{ query:
{ '$or':
[ { name: { '$regex': 'Doe', '$options': 'i' } },
{ name: { '$regex': 'Doe', '$options': 'i' } } ] },
generator: 'function (util, ...params) {
return {
// "find a contacts with name or lastname is Doe"
$or: [
{ name: { $regex: \'Doe\', $options: \'i\' } },
{ name: { $regex: \'Doe\', $options: \'i\' } }
]
};
}' }
{"scope":"table","tableName":"ContactsTable"}
**But when I'm trying to pass the same prompt with variable ex: @workflow.user_input the query generated incorrectly and trying to find the prompt in the database instead of using it for conscruct a query.**
Copy code
LOGS:

AI Query generated successfully
{ query: { '$text': { '$search': 'find a contacts with name or lastname is Doe' } },
generator: 'function (util, ...params) {
return {
// "{params[0]}"
$text: { $search: params[0] }
};
}' }
{"scope":"table","tableName":"ContactsTable"}
4 Views