Why do my seperate "Page is loaded" create double database entries?

I have two “Page is loaded” workflows running on the same page.

Each has a different purpose.

  1. Here is the first “Page is loaded” workflow. The action triggers a custom navigation sequence. It’s important to note that the custom navigation sequence doesn’t create anything in the database.

Screen Shot 2021-01-03 at 11.47.47 am

  1. Here is the second “Page is loaded” workflow. It should only run when the URL has a param of “oa_connector=direct_connection”. The action creates a new “Twitter Auth” thing in the database.

Screen Shot 2021-01-03 at 11.48.09 am

The problem is that I am seeing double entries in the database for the “Twitter Auth” thing.

To debug the problem I stepped through the app to see when the double entry is made.

It seems that the first “Page is loaded” workflow is ALSO creating a “Twitter Auth” entry in the database. But I never told it to do that.

I only told the second “Page is loaded” workflow to do that, so why does the first workflow create an entry?

And what’s the best way to stop this from happening? I cannot add the opposite condition of “only when oa_connector param is empty” to the first workflow because that would break my navigation. I still want the first workflow one to run if that param exists, I just don’t want it creating a Twitter Auth entry in the database (because I never told it too!).

Why two events? … Usually two events are used when conditionality is opposite to each other.

Suggestion: Other than trying one event that still may cause trouble … Consider routing users to one empty page that acts as a traffic cop. Build all your redirect nav logic there. If a user needs to go the Twitter route … create a url parameter to send to the empty page … and set that page to go the Twitter route if the url parameter is present. If a user needs to navigate to other page or pages based on user type (admin vs regular users for example) send url parameters or dB fields for this happen and to be monitored by page loading conditions on the empty redirecting traffic cop page.

This technique is somewhat elaborate but useful for elaborate navigations and sign ups. Sorry for the redundancy here…

1 Like

The two workflows was more of an organisation thing I guess. I’ve always added a new workflow when I wanted to do something new. Didn’t realise they needed to be combined if it was using the same event.

Will also try out the traffic cop technique!

1 Like

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