Temperamental Workflows | No Button Click Restrictions

Hey All,

I am not certain this is a bug just yet, but I have never seen this behavior before and I have been building on Bubble for nearly 6 years, anything from simple one-page forms to complex ERP systems.

Recently, I have been building out a transaction (real estate) management system for a family member and one of the functions is a CRM. I have a “Contact Details” view that allows for updating of needed contact information. These contacts are using the default ‘User” type with some extra fields.

My Save button is wired up to two custom event triggers that are conditional, based on the type of User. Either it is an “individual” or a “company”. This is where my problem lies. Sometimes the button works, sometimes it doesn’t, and when it doesn’t, the Bubble logs don’t even record the button was clicked in the first place.

My first thought was that the “Parent Group User” was not always getting loaded meaning it didn’t meet one of the two conditions, but that can’t be true since the contents of the page are populated from the same source. I am doing a “Do a Search For” on the URL value after details to match to a specific user.
image

Just to be safe, I added a step before the conditionals to throw up a Toast alert to say the button has been clicked. To my surprise, for the Users that don’t play nice, the Toast never triggers either. It also doesnt hit the breakpoint flag on the button click action in debug mode on “Step-by-step”. This has me stumped because, regardless of what is going on in the following steps, the Toast should always trigger. I have zero restrictions or conditionals on the button itself. Even weirder still, when I remove the custom event triggers all together, it works 100% of the time.

What is my Event doing you might ask? Nothing overly complicated. There are a few steps, but most are fairly simply functions that are just updating fields assigned to the contactRecord.

I spent about 3 hours on Sunday completely rebuilding, from scratch, all of the flows and logic to see if it was something I was doing and, best I can tell, it doesn’t like something in the update process but I cannot, for the life of me, figure out what. What makes this especially more perplexing is all of the original logic used to work just fine until a week or two ago (hard to pinpoint when it stopped since the sole user of this application does not use it frequently, yet, since we are still building).

If anyone has any ideas on what would prevent this from working, and more importantly, note even throwing an error in the logs, I am at my wits end and would greatly appreciate any suggestions.

  1. Check again that the parent element data exists. Go up the element tree to ensure that they all point to the correct data source.

  2. You should not set up button events that way. Create multiple Button Click events with different conditionals instead of one click event triggering actions based off the required button click conditionals. What you’re doing is potentially triggering all actions.

For example Step 1 triggers > an action in Step 1 (a custom event) updates the User contactType from Individual to Company > Step 2 will also trigger because of changes to User in Step 1

See if that fixes things for you first.

Thank you for those suggestions. I should have mentioned that, originally, I had the button clicks separated. I’ve only consolidated to try and reduce variables. Nonetheless, I’ve split them back apart and the result is the same, no response from the button click.

I did also check again that the Parent Group is getting populated and it is. There is a “Content Main” group that retrieves the Contact Record from the URL and then the groups within it all reference that main element. In this case, the “Contact Info” is a level 2 group of “Content Main” and then the Save button is a level 3 group, if that makes sense. I have confirmed each level is aware of the parent user.

What bugs me is the Toast is not getting triggered at all. I’ve just removed all the conditions on the main flow and still nothing. Maybe I’ll delete the button and re-add it incase something weird is going on there.

Ugh. I figured out the problem, although I have no idea why it was a problem. I removed every field from the update function and then added them back one by one, testing in between each. When I added back “Company” it stopped working. Took it out, works again. I created a separate step just to update Company now, and that seems to work.

The only difference is that now Update Company gets the value directly from the dropdown value instead of passed to it as a variable…

1 Like

That makes sense. If your user wanted to change the value of the userType, you would need to grab the value from the user input. Otherwise you are taking the values from the saved record.

Bubble has presented another mystery. I pushed all of this up to the live site shortly after my last post, tested it again a few times, worked on a couple minor things the following day, and then put this project on the shelf for a few days. I just returned to continue working, only to find that all the work I had done on this contact flow is gone and I am back to my original code. My commits before and after, all preserved. But all of the testing commits and final fixes for this, gone. At least I have screenshots I guess…

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