I have a server action that runs in a condition, on the client side, I have it set to on success rerun the same script over and over again.
That all works well, however to stop the script when I know it is really done, I have set a server connect response code of 204 which stops the script sending the success event.
This has me wondering what codes I can use on my server scripts that App Connect listens for, if success is 200, then what code is used for say the done dynamic event.
Could this list be completed, and/or corrected if I already have some codes wrong, I assume some of these are specific to Wappler / App Connect / Server Connect, but I assume some are just the universal status codes.
Yeah I figured some wouldn’t, but are the ones I have completed already in that list correct, and could I act upon them by setting that as the response.
Just wondering if it even works that way at all, or if it only really applies to success
Do you mean I could add a server connect response on the else step of any random number with a name, and I can then target that in App Connect. So lets say in Server Connect I add a custom response of 299 which does not exist in the real word, and call it customstatus
Can I then add my own event in code of dmx-on:customstatus="anotherscript.load()"
Not really.
You can set a response with a custom name and a status of 299 -that’s right.
But then you don’t call it like dmx-on:customstatus="anotherscript.load()" - you can just check the status code dmx-on:done="serverconnect.status == 299 ? dosomething : dosomethingelse" or eve better - try using flows with conditions inside which check the status.
Thanks Brian, I can’t believe I did not find your thread when I searched before asking here again, I hate people that just ask the same questions without searching, so a little disappointed i didn’t find it. Anyway it looks like. between this thread and yours, Teo has also given more insight to your last question of how you could conditionally trigger an event based on the status code returned, so hopefully that helped your understanding a little too.