Hello,
I want to make sure I limit the text sent to openAI.
How would you watch a Google doc and monitor its characters’ size?
@samliew samliew said, “You can use the “Get Content of a Document” module and filter with a built-in function length on the content.”
I tried but can find how to do this. Should I code it? Use an existing Module, if so which one?
Thanks
Stan
There is a “Text Content” variable that is returned as part of the ‘Get Content’ module.
You can then use the ‘length’ function on this variable to view the length of the content which gives you the number of characters that the document contains. You can then use that number in a filter to alert you when a certain number of characters is reached.

2 Likes
Thank you so much @Khurram_Aziz
I think I am on the right track however I still have a few questions.
Not sure where to find the name of the function length

And in my filter I am not certain I call the right variable since it is = to 0
Although when I run it is is not zero
@Stanislas_Berteloot You’ve added in a formula in the variable name field. This should just be a string (something like “length”) and you should then just be able to use it.
2 Likes
Thanks,
Can you tell me where to click to find this string? Can I just write ‘length’?
@Khurram_Aziz
OK I figured out that indeed I can just name it however I want.
2 Likes