This looks much like a bug. It manifests when there are set value statements in the body of a repeat.
Once they are there, even if you removed it, the problem persists.
I have the feeling that this is unrelated to the position of the insert (inside or outside the repeat loops) but rather by the number of nested repeats and the number of set value statements inside each.
I’ll see whether I can reproduce in a smaller server action (the one I was working on is a batch job and thus is very large and has a lot of “noise”) and get back to you.
When inside the repeat I try to access the result of statements in the repeat, I can see the problem.
In the example below, when I try to put the expression in the repeat2_at_level1, I don’t see the 7 variables and the query1 anymore, only the first 4 variables defined at level 1.
I’ve not yet managed to reproduce your issue, but is what you are trying to say that not all set value steps are accessible using the UI?
What if you just enter their names wherever you need them?
And it’s not clear to me - where are are you trying to access them from? Is it from the same level, or is it from within a sub-level repeat?
Can you please make a short video showing exactly what’s wrong?
Check whether the Case exists, i.e. if idCase is empty or not.
If the POST is not empty, it is because the Case exists and I will use it later in the server action. To do that, I assign in this step its value to a variable called idCase (which should not be confused with $_POST.idCase. I just call it that to make it easy on me to know that it is related to what I passed in the POST )
If $_POST.idCase is empty is because the case did not exist and I should insert it.
The next step is to assign the ID of the record created in step 3 above to the server action variable idCase. I want to use the identity value returned by Step 3. So I go to the Properties of the idCase variable, and click on the binding button with a red 5 beside it.
When the Server Data Bindings modal opens up (see next picture), it does not show the insert called add_Case from where I can then select the identity.
Is the above sufficient to describe the problem? I know that what I include here is not the same as the previous description but the problem looks pretty much related. The server action binding does not show all the elements so I cannot choose from them.
Let me know if this helps and if you still need a video. Many thanks in advance,
It looks like if a statement is in the “outer” parts of a conditional (or of a repeat, which is what I found first), the binding action in inner parts can see the statement but if it is inside, however, it has problems.
I don’t know how Wappler’s parser works internally so I can’t tell if the two are related but I’d really really appreciate a fix
Many thanks in advance and please do not hesitate to tell me if I can help in any way.