Unstable Flows, Dynamic Events, Etc?


— SOLVED —

Long story short was getting dmx.actions is not a function. Solved by Teodor’s post

You are using a really old App Connect version on your page (from 2018), where flows are not supported.
Delete the dmxAppConnect/dmxAppConnect.js file from your local site folder. Save your page and this file will be recreated.
Make sure to upload the whole dmxAppConnect folder to your server.



---- Original Post ----
Unfortunately, several hours into my Wappler experience I am running into inconsistent error after inconsistent error with client-side Flows, Dynamic Events, and Conditional Logic. What am I doing wrong?

I consider myself pretty technically proficient (software dev) but I am still at a loss when I don’t get any error, don’t know why seemingly simple dynamic events don’t trigger, or why following general advice (reinstalling Wappler, creating a new project, going through every line of javascript to see if I can discern anything) doesn’t work.

I don’t want to jump to the conclusion that Wappler is unstable on these features, so I will take the blame as a newbie.

  1. What general tips can other Wappler users share that have experienced what I am experiencing?

  2. Any best practices around using flows (I found the documentation non-existent/underwhelming)

Thanks!

Hello,
Maybe if you provide a specific example / link to the dynamic events or flows and conditions which do not work we will be able to help you.
Most probably it’s an expression or logical issues, but without seeing an exact example it’s hard to tell why “it doesn’t work” :slight_smile:

Teodor. I appreciate your response.

Here is a simple example I made for you.

Clicking “Log In” btn should trigger flow1 (which triggers notifies1 danger when username is invalid and triggers notifies1 success when username is valid).

Clicking button doesn’t do anything. No triggers, no false positives, etc. What am I doing wrong?

Attached are screenshots.

Hello,
In order to check the username you need to submit the form. So you need a server connect form sending the POST variables to your login server action.
Then you can check the reply of the server action and show the notifications based on them. Not sure where did you get the {{username.invalid}} expression from but it is no way related to a wrong username entered in the inputs.

I suggest you to start with the basic docs, explaining how to create login page to learn how the things work. It also explains the proper usage of success/error dynamic events:

Teodor. Thanks.

Unfortunately, I don’t think you understood the spirit of my op.

In order to check the username you need to submit the form. So you need a server connect form sending the POST variables to your login server action.
Then you can check the reply of the server action and show the notifications based on them.

#1. This is not a form.
#2. I am not asking about server-side validation (checking vs a list of db usernames for example) I am asking about client-side validation (and using those in flows).

Not sure where did you get the {{username.invalid}} expression from but it is no way related to a wrong username entered in the inputs.

#1. Why can’t I use the boolean in the flow if/then?
#2 Well then, what can I use on the client-side?
#3. See Screenshot for source

I suggest you to start with the basic docs, explaining how to create login page to learn how the things work. It also explains the proper usage of success/error dynamic events:

#1 Again. You are missing the spirit of the question. I don’t want serverside events. I want to use client-side events…
#2 edit I checked over these docs and they didn’t answer my question, but thanks!
#3 I still don’t understand why this doesn’t work on just a basic logic level.

Maybe what would be helpful is to point me to where client-side validations are used inflows? Is that something that can be done?

Like this Use-Case: Submit api-action when input is valid (automatically).

Well your use case looked like a login form - that’s why i though it’s a login form…

The expression you are using {{username.invalid}} is related to the validation state of the input. You need to apply some validation rules to your inputs to have the input valid/invalid
Your question is too generic and i can’t provide a simple answer to “I don’t understand why this logic doesn’t work” - i also don’t know, as i don’t know what your logic is.

I see two inputs and a flow, and nothing else.
If you explain what is your idea on this page a little more detailed, what are the inputs doing, what are you validating? Is it dynamic data? Where does it come from? How it needs to be validated? What is the point of the inputs etc etc etc we will be able to help you.

Well your use case looked like a login form - that’s why i though it’s a login form…

I appreciate that. I could have been more clear. Thanks!

The expression you are using {{username.invalid}} is related to the validation state of the input. You need to apply some validation rules to your inputs to have the input valid/invalid

#1 If you look at my op, you will see that I do have a validation rule on username (see screenshot). Please refer to op.
#2 I know that the variable username.input is related to the validation state of the input. That is why I want the flow to check the validation state of the input in the conditional if/then.

Your question is too generic and i can’t provide a simple answer to “I don’t understand why this logic doesn’t work” - i also don’t know, as i don’t know what your logic is.

#1 Here is my logic (from my previous post): "Clicking “Log In” btn should trigger flow1 (which triggers notifies1 danger when username is invalid and triggers notifies1 success when username is valid)."
#2 What else do you need from me to clear this up?

I see two inputs and a flow, and nothing else.

#1 That is the point. This is a simple example to illustrate the difficulties I am having with Wappler’s basic building blocks (Probably my fault. That’s what I am trying to figure out)

If you explain what is your idea on this page a little more detailed, what are the inputs doing, what are you validating? Is it dynamic data? Where does it come from? How it needs to be validated? What is the point of the inputs etc etc etc we will be able to help you.

#1 Here is the basic question: why aren’t client-side dynamic events triggering flows as expected (based on the example I gave above)

you need to validate your input from the flow.

input.validate()

2 Likes

Should be working perfectly fine.
The thing here is that the input validation will only be applied on form submit, or you will need to run the validation in the flow.

You will just have to put a small timeout after the run validation step, as the Run steps are executed asynchronous and the condition step won’t wait until it’s executed, so the validation state will not be set yet:

All the other steps in the flows are executed sequentially.

2 Likes

Also as you said you have a tech background know that flow steps are chained promises. Knowing this will save you from a small headache in the future when you are trying to figure out things.

1 Like

@JonL Both of those are helpful! Thanks!

1 Like

@Teodor ,

Appreciate it. Set up like you had in the screenshot (Thanks!). Here is the error I am getting now (console on page-load). Shouldn’t Wappler auto-inject scripts for dmx or am I missing something?

Can you provide a link to your page, where i can inspect your code?

1 Like

@Teoder

I Dm’d you

1 Like

You are using a really old App Connect version on your page (from 2018), where flows are not supported.
Delete the dmxAppConnect/dmxAppConnect.js file from your local site folder. Save your page and this file will be recreated.
Make sure to upload the whole dmxAppConnect folder to your server.

1 Like

@Teodor

Wow. That fixed everything. Thank you so much! I knew something was wrong!

Why was it so old? I made that project yesterday?

Thanks!!

You probably had some old Wappler version installed?
Or maybe you tried it before and the file was left there for some reason…

Interesting. I first installed Wappler ~mid-summer 2019. But made sure to wipe it all before I re-downloaded wappler yesterday…

Regardless… It works! Thanks so much! You have saved me a huge headached.

Thanks, Teodor!
Andrew

1 Like