Javascript help please

Hi, I have some javascript that allows me to insert text into a rich text editor wherever the cursor is. Right now I have 2 problems.

  1. The first couple of times I click the repeating group field, nothing happens even though in the step-by-step debugger the workflow if firing as it should. After it works the first time it works every time thereafter. Bubble support won’t look into it because it has to do with the Javascript.
    (It doesn’t do that when I remove the JS and use a workflow instead, the downside is I can only append the text to the end and not insert it where the cursor is.

Problem #2 - It’s currently inserting either the “heading” or the “example” text. I need it to actually insert the parent groups “swipe” instead.

Here is the database:

Here is the workflow and js I’m using

In case it helps, here is a link to a video explanation also showing the debugger as it happens:

I really appreciate any help!

This topic was automatically closed after 70 days. New replies are no longer allowed.