I want to check this variable if it has particular state returned for security, if the state is correct I then want to run a flow to send this to the server.
I haven’t worked out how to search for this state parameter yet but for now I have is not empty, my question is does this condition when met at anytime run the flow? or is there something else i’m missing. If I auto run will this only run once or every time the condition is met. I would expect there to be a condition input to be below the auto run checkbox.
You cannot put a condition on the “auto-run” param by UI. Same goes for “auto-load” for server connects.
But, you can try to dmx-bind these properties. I have used on server connects, so here is an example of that:
The noload param needs ‘noload’ value to stop server connect from loading automatically. Anything else, and it will not auto-load. Using the ternary operator in code view, setting value becomes dynamic.
Although, this does not always work. I am not sure why, but I have seen this fail for me at some places.
As for JS, you can use that too.
Just use dmx.parse() method to run access and run Wappler’s DMX stuff. dmx.parse(' varSome.value == "xyz" ? myFlow.run() : "" ')
Maybe that's why I see inconsistent performance on this. Thanks for the info.
I use it in SPA content pages. I have cases where content page's server connect uses some variable from main page. So, once this content page has loaded in the memory, then, even if I am on some other content page, changing the value of the index page variable loads the server connect of earlier content page - even though its not visible (but was loaded - so "in memory").
Just configure this on the page using Wappler’s action picker somewhere… Eg on a button click… There you will be able to see the syntax of passing params to flow.
Or i can share that later when I log in to my system.
ok thanks but I’m running the code from javascript,
I think I don’t need a flow anymore, I’m trying to use server connect directly post to pass the code and state. Still I’m unsure of how to do that, could you show me please?
Something like this. But this works only for GET params.
If you want to do POST, you will have to either create a Wappler form with hidden fields, set them in JS and do a ‘form1.submit()’ from JS.
Or, use AJAX.