Update Record Page

I’m trying to build a record update page.
I configured action update and now I have generated the page
But I’m confused about how to populate the various fields
How to use Populate and Value?
Thank you

I suppose your page will have an id on his address like

updaterecord.php?id=10 (where 10 is the id of the record to modify).

Supposing you have a form in your page where in the form fields you want to show the values to modify, then you must:

create a different server connect script where you do a query in the table of the record you want to modify filtered by a GET variable.

add the server connect script to the page and when you go to make the update server connect form, in populate you select the server connect script you prepared before.
You should see all the values at their place…

This is valid if you want to make appear a form with already filled values in each field form and your user will modify the field he wants.

maybe I m not very clear but with mobile it is not easy write… in case just ask …

1 Like

I finally managed to populate the form with the record data
But now how do I configure the submit button to upgrade?

the bootstrap 4 form generator should generate the submit button too and It should be ready to work as it is…

today I repeat from the beginning and see if I can make it work
Thanks for the assistance

I have been working on a few videos for wapperunwrapped.online and have a very early draft video of updating a record which may help. Its pretty poor narration and a bit rough around the edges however it may help. I have dropped it onto the server and it can be accessed directly via http://wapplerunwrapped.online/video/lesson4.mp4

Thanks Hyperbytes
now works. The problem was that I did not do the Query Manager

1 Like

hello Hyperbytes
I have a small problem. I restarted several times from the beginning to verify the operation of the update, but now when I create the step update, in the condition section it does not automatically appear to me the associated variable and if I try it I can not find it
Maybe it’s because in the database the id is numeric and the variable is set as text?
Do you know what the problem is?

I think i follow what you are saying.
Certainly the problem will not be the data type of the ID.
Just to quickly outline the requirements.
At the server connect end you need two queries, query one is to retrieve the data from the record based n the id field via the $get variable and it populates a series of form fields from that record.
On submission, a second query is needed in the form of an update query which write back the values of those fields to the table. These values are sent in form of $POST variables. A good check is to make sure your form action is set to POST and not GET or the update will fail.
When creating the update query Wappler should create all the necessary post variables for you which can be found under GLOBALS within the server connect action. Check they are present, if not then there is something wrong with the server action.
If the $POST variables have been created then the condition will be idfield is is equal to {{$POST.idfield}} where idfield is the name of your table ID column.
Incidentally the query manager is effectively the “glue” which links the server connect $GET and $POST variables to their associated App Connect JavaScript variables.
Hope this helps

but the variable $ _POST id is not automatically generated?
I try to find the cause and let you know

I think I found the solution
If you can tell me if everything is correct for you

update.mp4 (16.0 MB)

Around 6m 10s in the video you create a query manager but don’t create any values within it. You need to open the query manager and create a value matching the name of the $GET variable, in your case “idtest”. This will bind the query to the $GET.idtest value. Other than that on a quick run through is seems ok
I think your current query will always show the default value 1 which you set

Ok now is correct
Thank You