Find Records with Insert Help
# 🤝help
c
I have a properties table I want to check string output value that check: • if the user output matches 3 of 3 items from the row that connected to the client's phone number => change node to existing property else continue with the flow. I always get an error
f
Which of the cards throws the error?
c
the expression
thank your helping me again 🙂
f
You are very welcome. Can you send me the code you have in your expression
c
sure workflow.output.agentPhone.length === 3 && workflow.output.agentPhone.every(phone => typeof phone === 'string')
I think I need something like this: const phoneNumber = workflow['PhoneNumber'] const street = workflow['Street'] const buildingNo = workflow['BuildingNo.'] const aptNo = workflow['AptNo.'] const requiredFields = [phoneNumber, street, buildingNo, aptNo] const missingFields = requiredFields.filter((field) => !field) if (missingFields.length > 0) { return false }
but is not working
f
I take it that workflow.output is the variable set to have the output from your Find records card?
c
yes
I try to build simple tasks that check records before adding them, but it must check 3 of 3 columns from the table that relate to the specific row; if it is 2 of 3, the user can add records. If it is 3 of 3, he can't
Example: User Bob wants to add property to Alice's client, but Alice has this properly already (how does the bot know? he should check 3 of 3 parameters from Alice properties)
f
I can take a look at it if you send me your bot. Make sure to delete any sensitive information first
c
I have a lot of private information there; can we do it another way?
f
Yea
Can you send me a screenshot of the information returned from the Find records card
c
ok I think the problem is from the insert Records Error, An unexpected error occurred when trying to process your request. (Error ID: err_20240303170933x5F9ECA8D)]
f
Can you send me a screenshot of your insert record card
c
Hey, I fixed the issue; I'm still not figuring out how to make an expression that finds multiple records matching.
It seems like Botpress can't be a sort of replacement for CRM platform :/ @fresh-fireman-491
f
I would disagree here. This is 100% doable, we just have to figure out how. Going back to school tomorrow so my time will be limited, but I would recommend you to create a new help post about this new problem. Make sure to include all of the information that could be helpful for someone else to try and fix this. This includes the steps on how to reproduce this, and what you are trying / have tried.
18 Views