The only way I know to send data from custom scripts back into Bubble is with Javascript to Bubble elements.
So before settings your dataPoint object you would call the function you configured in the element (ex. bubble_fn_loop(i);).
Then you’ll be able to refer to the item#:
Current User's PassPath:item # Javascript to Bubble element's value
You’d have to configure the Javascript to Bubble element to publish a number value
The problem is not on the value used to call the function. The problem is that when I run bubble_fn_loop(X) in a HTML element, it does not run. Is it suppose to work from an html block?
Only seems to work when running it from the workflow javascript action.
Might be possible that the function is called before the Javascript to Bubble element has loaded…
Perhaps you could add a while loop with a condition that tests if the typeofbubble_fn_loop() is “function” or “undefined” to determine whether to run the for loop or wait a bit to let the element loads.