Wow! This is driving me mad

This is on my Dev machine as I really don’t want to upload to a live server until resolved.

I have an SPA with a routed content page. On this content page there are 3 modals. In one of the modals is an INSERT query (Action Step). It seems straight forward but the problem is that every time I refresh the SPA page by using F5, Ctrl-F5 or Ctrl-R, or come back to the page from looking at another page, it triggers the Action Step and another ‘blank’ line is added to the database. How can this be? I really can’t understand it.

I know it is definitely this INSERT query because I put a default ‘6’ in the ‘active’ value in the query as a test marker.

Here are some screenshots of the code…

Can anyone spot what might be wrong?

By default, server actions run on page load - unless you specify:

image

I think you may have forgotten to choose this option. (In fact I don’t think you need this server connect action anyway - as you use it in the form action.)

1 Like

It’s always the simple things I seem to overlook. Thanks @TomD that suggestion has certainly stopped the auto insert. I can at least move forward again.

Wappler is a wonderful application but I still struggle with some of the more basic elements. Ah well, I keep persevering :smile:

1 Like

Why are you loading the insert action from a server connection which runs by default on page load rather than Server Connect Form Action which is only run on submit?

1 Like

Good question. As I said, I fall down on the simple things. This is where I need an idiots guide such as

C - You do this, do that, do the other
R - You do this, don’t do that, do the other
U etc
D etc

as a simple example. I’ve started to put one together after watching various videos but seem to have got that wrong! Haha.

Will be covering doing a record insert from a form within a modal next week in webinar, that may help I hope, It’s really easy once you know how but I totally identify with waiting for that Ah!!! moment when everything clicks into place. It took me about 6 months until all the puzzle pieces started to fit together into a full(ish) picture. Once it does you feel you can fly.

2 Likes