AI Copywriting - User Word Count

Hi there. I am very new to Bubble but learning fast. I am in the process of building a small AI Saas, and since I’m in South Africa and can’t use Stripe, I have opted to make the trial period a word allocation-based trial. I would really appreciate some help with this. I would like to allocate X number of words for a new sign-up as a trial. These can be used for generated content using the AI API call for copywriting. Once these words are all used up across the different pages, the user would then be required to subscribe to get (X) x (X) number of words as part of their subscription that gets renewed every month. I have no idea how to set this up, but I am determined to figure it out, with the help of fellow Bubblers. If there are any resources that I can visit, I would really appreciate being pointed to them.

Looking forward to hearing from you.
Eddy H

Hi there, @hinson.edward… one way you could go is to use the :split by operator any time a user generates content to split the content by a space character (literally type a space in the Text separator field), and then add the :count operator to the end of the expression to get a count of the number of items (in this case, words) in the split. If you wanted to, you could save that number to a field on the User data type, and you could keep adding to the number as the user generates content. When the number is greater than the allowed number of words for the trial, disable the user’s ability to generate new content.

Hope this helps.

Best…
Mike

1 Like

Hey there @mikeloc
Thanks for the advice. That makes sense and is helpful. I will try it and see what challenges I face. I have never done this before so, I’ll probably be back soon :slight_smile:

Eddy H

1 Like