AppMachine Help Center

How can we help you?

Follow

AppMachine API - Step 9: Update Profile

Previous steps taken

  • (PUT) Added the web service for updating the user their profile
  • Connected the correct id from the datastore so we will update the current user their profile
  • Connected the “Edit profile” button in the “info” block of “My Profile” block to go to the “Edit Profile” block in the Logic tab
  • Made a layout for the Edit Profile block and show the current profile data.

 

Step 9: Connecting the form to the UPDATE web service

When you drag a textfield into the layout and go to “source” it will look like this.

<textfield name="Textfield1" height="44" label="" margin="5" showclearbutton="false" halign="left"></textfield>

We need to add this line of code to connect it to our PUT web service.

  1. binding="Dataprovider8.firstName"

<textfield name="inputName"  binding="Dataprovider8.firstName" height="44" label="First Name" margin="5 20 5 20" value="{data:firstName}" showclearbutton="true" halign="left" label-margin="4,5,20,5" label-fontsize="17" label-textcolor="supportColor" />

 

The binding is the name of our PUT web service (Dataprovider8) and the field is “firstname”.

You can find the name of the web service when you go to the Developer tab→ Services

When you click on the dataprovider and go to “input parameters” you will see the fields you need to add if they are not already there.

Add the "binding=dataprovider8.fieldname" to every control you have in the layout.

Next step is to connect the “update” button in Edit Profile layout to execute the Put Web service.

If it’s not already connected automatically these are the steps to take.

Go to the Logic tab of the “Edit Profile” block and connect your button to the web service and click save. (updateBtn.click → + →  webservice → Update Webservice  → Finish)

Now we have connected our form fields to our web service. So when the user updates the fields in the form, the current info will be updated in the “Customers” data store.

Summary

  • Connected the fields from our form (in source)  to our web service fields
  • Connected the “update” button to our PUT web service
  • This concludes our “Profile” section (GET/POST/PUT), next step is show data in the app and make a wish list that we can connect to our currently logged in user.

 

Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request

Comments

  • Avatar
    bam

    I'm having problems at the beggining of step 9 - when I include the binding="Dataprovider5.firstName", all the fields disappear and I get a parsererror in the form.
    How do I solve that?