Changing Record ID dynamically when using the Reco...
# 🤝help
w
Hey @numerous-room-43560 , first of all, you can disable the search in KB in your raw input and in your price card (because you don't need a response from your KB I think)
Then, after your raw input card ("result"), add a find record card
and store the result in a variable
Assuming yor supplier will enter the right name, you will get only one result, so you can get the record id with this expression :
you can click on the {x} (in the update record card) and add {{workflow.your_result_variable_from_find_record_card[0].id}}
n
Hey @wooden-beard-40210 First of all, thank you for your time. I applied your steps but I face with this error. also one correction; price card will be what is your new price? https://cdn.discordapp.com/attachments/1253267334257311785/1253393087754014860/Screenshot_2567-06-20_at_19.48.57.png?ex=6675b0c7&is=66745f47&hm=84057336fd967012f0f0b05aac603ab9a6c6f81931abc49438e39c45e644ab9c&
I didn't write something to the filter
w
Write {{workflow.result}}
So the bot will search for the product the user is looking for
And what is the type of your variable findingresult
n
string
when I chose number I can arrangw for the finding card, It dissappear automatically
w
Try to set it up as an object
Even a string should work
I’m not sure to understand
When I set the workflow.findingresult variable to number in the variable setting section on the left, the selected variable section in the find record card becomes empty. I cannot use a variable of number type as a variable in the find record card.
I set up as a object again find record Card's result variable is empty
w
Did you set your columns as searchable in your table ?
n
yes
w
Okay , I will try to make you a quick video when I come back to my pc
n
I am really appreciate about your attitude.
w
wow i get a weird error with the find record card
a little bit like the one you get here but not exactly the same
i tried with code and it works fine
sorry my loom doesn't work lol
here is the code
Copy code
const productName = event.preview

// Find records in the productsTable based on the product name
const records = await productsTable.findRecords({
  filter: { name: productName }
})

// Check if any records were found
if (records.length > 0) {
  // Get the first record
  const record = records[0]
  // Log the record details
  console.log('Record found:', record)

  // Update the workflow results with the found record
  workflow.results = record
} else {
  console.log('No record found')
}
event.preview is used to get the last user's message
hope this will help !
and it's weird that the find record card doesn't seem to work