Nationality Form: Delete
Configure the nationality form to delete a record.
This is the process we will follow.
DELETE
Add a 'delete' data source for deleting a single nationality record
Link the key nationality record identifier to this ReST API end-point if necessary
Map the custom variables mapped to the form fields to the data source body fields
Assign this 'delete' data source to the data entry form
Configure the delete button
Test that we can delete a nationality using the Delete button
Add a DELETE Data Source
Open App Studio, open the Data Sources configurator, select the Nationality folder you created previously, then use the add button menu to create a new request:

The Add New Request modal popup form shows asking you to name the request:

Type a meaningful name such as "Delete Nationality" and click Save.
The request will be added to your tree view beneath the Nationality folder. Take this opportunity to drag and drop the order of the requests to fit the CRUD acronym:

Edit Properties
Edit the properties in the Details tab by referencing this list of ReST API end-points.
URL
https://football-891b.restdb.io/views/DeleteNationality
It is known from the documentation that this ReST API end-point has a nationality identifier property ?ID=.
We therefore type this parameter list into the URL so that it reads:
https://football-891b.restdb.io/views/DeleteNationality?ID=
Whilst the caret is still blinking after the last character typed, click on the Insert Variable button:

This will open the following modal popup for where you should select the Nationality-ID custom variable you created previously in the Variable drop down list . Click the Select button.

The URL should now show the custom variable appended to the end:

HTTP Verb
The default GET verb/method is not correct for deleting a single record using the ReST API and should be set to DELETE for this specific back-end end-point.
The request should now look like this:

Authorisation
Previously we set up security credentials at the Football folder level, so we can leave this to be set to "Inherit from parent".
We do not need to change anything else.
Send Request
It is best practice to now click this button on the Details tab to send the request to the ReST API.
The problem however is that we would have to delete an existing record in order to test this.
The best way of course to test this is to use the actual nationality form we created here, and link that form to this data source request, then we can test it.
Edit Form
Open App Studio, open the Forms configurator, then select the Nationality form:

Click the Edit button to open the form properties modal popup.
Data Sources
Click the Data Sources tab. There are 4 CRUD data sources lines. Click this database icon to assign the Delete data source:

This modal popup form appears to allow you to select the previously created data source request. Navigate through the folder hierarchy until you locate this data source request, then click the Select button.
This Delete data source request should now appear in the list of assigned data source requests:

If you ever need to remove a data source request from the list, you can use this button:

Now click the Apply button on this form, in order to persist the form properties. The Delete data source request you added should be shown in the properties list:

We do not need to design the form.
We will now configure the delete button on the form.
Configure Delete Button
Open App Studio, open the Forms configurator, then select the Nationality form and click the edit button. Then click the CRUD tab:

There are four mechanisms to control: Create, Read, Update and Delete. We are only interested in Delete at this stage.
Delete
The delete button lives together with the update button top right on the form:

It can be hidden, its caption set and its icon set using these controls:

Apply
Apply any changes to persist them before testing.
Test
You can now test your configuration by opening the Football Industry group in the navigation bar and selecting the Nationalities item. Drill down into the last test nationality you created to open the form.
Press the Delete button. You will be prompted to confirm the deletion.
The form record deletion should be confirmed when the form is closed:

Last updated