Speed is an issue

so sorry. I think ive had it open too long

This should work and i already made it public

Got it. you certainly have a good deal happening when you trigger the Plus icon.

-First thought is it looks like “Group order entry reset” is in the wrong place. You have it up front instead of at the end. (you are calling on data from this group, but resetting it first?)
-Second thought is that you have the “Only when dropdown conversion value is x” checker in the event logic rather than at the on click level. This means that the process must check “every” instance of a “only when” rather than just working on the singular path (ie- when conversion drop down is “1”, just do what is required for “1”). right now it does everything every time. (this might help).
-Also- there may be a way to reduce your code and logic if you differentiate between what is the same between all the step and what is different. If you write on action that produces what is identical in all paths, and then break out was is different into smaller buckets with an “only when” gate, then you might lighten the load.
-And— on click you are creating a new “order item temp”, new “sales order temp”, new “order item” and new “sales order” --then-- making changes to lists of “sales order temp” and a list of “sales order finals”

This is definitely a lot of processing. Try removing the list modification aspect temporarily to see how much faster the cycle through is. also, what are the the temp order item and sales order used for? If they are just for the current user session, then you might think about using “states” (set state), rather than generating DB interaction.

Hope this helps.

Sam

1 Like

Wow!!! Thank you!!!

I put the rest first out of frustration. will move that.

"Second thought is that you have the “Only when dropdown conversion value is x” checker in the event logic rather than at the on click level. This means that the process must check “every” instance of a “only when” rather than just working on the singular path (ie- when conversion drop down is “1”, just do what is required for “1”). right now it does everything every time. (this might help)."

This is amazing i never thought of structuring things that way. I will implement this as well as other ideas i had and i hope it wil be make it better.

**Also- there may be a way to reduce your code and logic if you differentiate between what is the same between all the step and what is different. If you write on action that produces what is identical in all paths, and then break out was is different into smaller buckets with an “only when” gate, then you might lighten the load.**

Ok Noted. I will do an analysis based on this as well and make the required changes

-And— on click you are creating a new “order item temp”, new “sales order temp”, new “order item” and new “sales order” --then-- making changes to lists of “sales order temp” and a list of “sales order finals”

I’m thinking of removing the temp table totally as i only need it as a reference to edit an order.

I’m struggling with the set state , i don’t really get it so i’ve avoided using it at all. I wish i knew it well enough to use it. I think ill try and read up on it.

In all, I just want to say thank you. Thank you… you have no idea how this tips you’ve given will change my whole app. I am so so grateful. Thank you for taking the time. Thank you.

Im really relieved. I appreciate you and all the tips

1 Like

Once I figured out “Set State” I started applying it everywhere. The hardest part is figuring out how to access it in the app.

-first off, a state is a temporary variable stored at the browser level for when you are interacting with the page.You define it ahead of time, but it’s value is only local to the page when it is open. So you can set it on page load, or through an action.

I use it to:
-pass key information into pop-ups. Like product ID numbers, or a certain “mode” that triggers the popup to act in a certain way. The default login pop that comes with the bubble app has a state mode trigger like this. The popup has a state and I set it from the popup open click (display the data AND then pass it specific info). Doing this has allowed me to create much more robust reusable elements and greatly reduced design redundancy.
-I also use it for navigation elements. IE- highlight nav element one when the nav state is “1” kind of thing. On page load set nav state to “1”, etc.
-lastly- I use it to capture temporary lists and variables that I then use to write to the DB upon popup closure or save. (don’t allow popup to be closed using esc, give it a code “x” button with some commands). This lets the capture of large info amounts to flow much quicker, and then write it to the DB when the popup is closed. (when people expect there to be a delay)

Plus a few other ways.

And, the biggest help was when I figure out that the “i” (info icon) in the editing window for each element is where you can access the state. Until i figured this out, I had so much trouble (just a few weeks ago!)

Glad I could help. Good luck.

Sam

1 Like

Thanks. I just tried your first line and i see improvement already. I also removed the make change to list and use make change to thing and it worked!!! Its magic. Sir i doff ma hat.

Thank you i am confident that these tips will change a lot for me. Thank you!!

1 Like