We are placing an HTML element in a popup and attempting to perform the process described in the HTML element when the popup is opened.
The HTML element describes the process of extracting 200 items from approximately 1000 items of data in the database and logging them.
The actual process is used in our business, so we cannot show it here, but the image is as follows.
We have narrowed it down to 200 cases with a state called groupId.
When a HTML element has dynamic data in it, the element becomes reactive, which means it gets run every time the dynamic data is updated. Loading data gives partial results as part of this.
You could try adding a conditional which looks at the last item, it might delay the update until all the data is ready.
An alternative approach is run the script from a workflow, where you have more control over when it is run.
On the properties there is a tab on the right called Conditional. If you create a condition and set something like Search for Tests:last item is not empty, hopefully Bubble will load all the items to satisfy the condition.
The action to take when the condition is true could be either:
Set visible to true, or
Set the HTML to the script as above (and make the default HTML empty)
Does Search for Tests:last item is not empty mean that the HTML element is set to “Conditional”?
I tried doing so, but it did not change the situation.
I also tried to run the script from workflow instead of the HTML element, but in that case I was not able to get the number of items that were selected.
In the example above, I wanted to retrieve 200 items, but was only able to retrieve 80.