greenrhyno
greenrhyno
TTypebot
Created by Rotivjr on 8/28/2024 in #help-and-questions
Hi there. Is there any way to avoid/block some types of files when uploading via typebot?
I run that then I have a conditional block that flows based on the result. Invalid types get conversion instructions then a button when they have the correct type.
6 replies
TTypebot
Created by Rotivjr on 8/28/2024 in #help-and-questions
Hi there. Is there any way to avoid/block some types of files when uploading via typebot?
I have code that checks after upload if its the type I want and if not, I instruct them to search for an online converter then loop back. Mine is images but concept is the same- check the file extension. function isValidType(ImageURL) { const fileExtension = ImageURL.includes('.') ? ImageURL.split('.').pop().toLowerCase() : 'FALSE'; return fileExtension; } // Example usage in Typebot return isValidType({{logoRaw}})
6 replies
TTypebot
Created by digitalcrew on 8/15/2024 in #help-and-questions
Conditional Logic For Lead Generation
I've learned you have to set it up how you think it will work then test things in every way possible. Only way to know if it will work the way you want/need.
13 replies
TTypebot
Created by greenrhyno on 8/19/2024 in #help-and-questions
LONG post/questions about WAIT, what gets processed between User Inputs and what is a user input.
For testing. Normally I'd wait longer but I wanted to see how a shorter time would affect it. It is just sending an image for processing then the repeated call pings until it's done but it can be a longer intervals and get called less. But I noticed this issue and wanted to see how diplaying more loops would affect it.
5 replies
TTypebot
Created by Joao on 8/19/2024 in #help-and-questions
Help with script in typebot
I fixed it but keep an eye out for that.
16 replies
TTypebot
Created by Joao on 8/19/2024 in #help-and-questions
Help with script in typebot
oh shoot and remember, in my experience at least, you never want a ; at the end of the return line where you call the function and return the result to your variable in the block...
16 replies
TTypebot
Created by Joao on 8/19/2024 in #help-and-questions
Help with script in typebot
You could use ARemover also but I just don't like one letter words in variable names with camel case just a personal preference use what you want.
16 replies
TTypebot
Created by Joao on 8/19/2024 in #help-and-questions
Help with script in typebot
Here you go: function updateArrayValue(array, index, valueToRemove) { // Subtract the valueToRemove from the element at the given index array[index] = array[index] - valueToRemove;
// Return the updated array return array; } // Return the updated array back to Typebot return updateArrayValue({{resultadoqtdArray}}, {{index}}, {{quantidadeToRemove}})
16 replies
TTypebot
Created by Joao on 8/19/2024 in #help-and-questions
Help with script in typebot
You do need a variable for your Quantidade a remover though- so like quantidadeToRemove
16 replies
TTypebot
Created by Joao on 8/19/2024 in #help-and-questions
Help with script in typebot
this is the way: Set your setVariable block to: resultadoqtdArray Then in the block: function updateArrayValue(array, index, valueToRemove) { // Subtract the valueToRemove from the element at the given index array[index] = array[index] - valueToRemove;
// Return the updated array return array; } // This line returns the updated array in Typebot's context return updateArrayValue({{resultadoqtdArray}}, {{index}}, {{Quantidade a remover}}); ---- I am actually going to be trying this in something I'm doing so this process turned out to be helpful for me too. I am not a coder so I use ChatGPT for help a lot- here is my dialogue for this so you can see how I use it to help me with code: https://chatgpt.com/share/3235ea9c-ec9e-424d-b6ff-40adab0f0a96
16 replies
TTypebot
Created by Joao on 8/19/2024 in #help-and-questions
Help with script in typebot
Oh I just realized- you will need to have a variable in your setVariable block which I would set to something like tempResultado Then in the block it is: {{={{resultadoqtdArray}}[{{index}}]=}} - {{Quantidade a remover}} And you would need to use some javascript in the block to basically rewrite the array with the new value. hold on---- (leaving this part in here so you can see my thought process but this is NOT the way to do it)
16 replies
TTypebot
Created by Joao on 8/19/2024 in #help-and-questions
Help with script in typebot
setVariable never worked for me either. I've tried. Only thing that has worked for me is ___ return myFunction() Or return myFuntion(parameters) But if you are just trying a simple function to update a variable, why don't you just put your resultadoqtd variables into an array instead of separate variables. The array woud look like this (and you could call it resultadoqtdArray): ["resultadoqtd1", "resultadoqtd2", "resultadoqtd3", "resultadoqtd4", "resultadoqtd5", "resultadoqtd6", "resultadoqtd7", "resultadoqtd8", "resultadoqtd9", "resultadoqtd10", "resultadoqtd11", "resultadoqtd12", "resultadoqtd13", "resultadoqtd14", "resultadoqtd15"] You can build an array programatically using a loop and the "append" option in the set variable block. And then your variables are now: {{={{resultadoqtdArray}}[{{index}}]=}} or {{={{resultadoqtdArray}}.at){{index}})=}} I prefer the first way- examples from typebot documentation here: Variables in Typebot Then, all that you need to do is set your index based on which value in the array you want modified (assuming you are storing that in {{codigoaremover}} - which I would write as {{codigoA_Remover}} or something more obvious. just corelate that to the index somehow so you are getting the correct value and remember arrays start at 0 so {{resultadoqtd1}} would now be {{={{resultadoqtdArray}}[0]=}} So you basically have to specify which product in the array you are going to change the value for and set that to your index variable. then your code block is just: {{={{resultadoqtdArray}}[{{index}}]=}} = {{={{resultadoqtdArray}}[{{index}}]=}} - {{Quantidade a remover}} That is all you need Should work fine but I am curious if there is a way to make that setVariable funtion work to set typebot variables through javascript if @baptiste weighs in.
16 replies
TTypebot
Created by Joao on 8/19/2024 in #help-and-questions
Help with script in typebot
But I guess if you are trying to use a switch statement and then testing which case returns the value in the parameter, are you expecting it to the case such as "case 4" or "case 12"? Sorry I'm not the best programmer but what are you trying to return?
16 replies
TTypebot
Created by Joao on 8/19/2024 in #help-and-questions
Help with script in typebot
Uh, for me usually I can only set the variable from javascript with a return value at the end. Could you just make this into a function and then solve which value satisfies the condition? The return at the end for me works without a ; So return myFunction(paramerters) But I'm not sure. I can't even understand what you are wanting from this- an array or one result..
16 replies
TTypebot
Created by greenrhyno on 8/15/2024 in #help-and-questions
Image from AI - openAI or other integration
I solved this by sending the base64 image to imgbb and it gives me a jpg or png url. BUT I'm having issues one of my other API calls returns RAW image data and it comes into tyepbot with a bunch of ? diamonds. I can't even send the data back out as it is corrupted or something because typebot can't read the special chars. I am going to ask the api creators if they can return a URL to me, but they are on vacation until the end of the month.
5 replies
TTypebot
Created by Dhaya on 8/19/2024 in #help-and-questions
Possible to integrate Google map?
I don't work for typebot or anything I am just curious what you are actually wanting. You can embed a google map already with the embed block.
3 replies
TTypebot
Created by Dhaya on 8/19/2024 in #help-and-questions
Possible to integrate Google map?
I think you are gonna have to be more specific. What are you trying to do with Google map?
3 replies
TTypebot
Created by Alfredo Neto on 4/4/2024 in #help-and-questions
http request multipart/form-data
Oh, and you have it set as a solution to get the form elsewhere and bring it in? Any chance we could just have the form right in the block similar to postman?
8 replies
TTypebot
Created by Alfredo Neto on 4/4/2024 in #help-and-questions
http request multipart/form-data
Hi @Baptiste - I just came here to request this and see it is already in the queue. I keep running into situations where this would be VERY useful as some APIs just seem to only work with form data. Plus it does make them easier to set up and run at times. Any chance to prioritize this one?
8 replies
TTypebot
Created by Gabriel Carvalho on 8/16/2024 in #help-and-questions
How to Handle Asynchronous Flows in Typebot: Pausing Indefinitely Until Client (User) Response?
It would be NICE if it were possible to have some sort of inbound webhook ability to pause a flow and wait for an action from a specific identifier/hook to continue @baptiste - I'm sure this in the feature requests OR there is some limitation/issue with implementing something like this, correct?
10 replies