Web service in ClaySys AppForms

Vinod Tharakan | Last Updated on : June 3, 2019


A web service is a software system designed to support inter operable machine-to-machine interaction over a network. In ClaySys AppForms you can connect to the web service to read/write data unless you have restrictions from the server to have the connectivity to the web service from the server. The purpose of this document is designed to be a reference for any person wishing to implement or any person interested in the architecture of the web service with the ClaySys AppForms.

Here we will be using a web service called ‘Currency Converter’, to get the conversion rate from one currency to another currency. The label will display the currency conversion rate of two countries from the two combo boxes. Also we can calculate the equivalent amount of money based on this conversion rate in the text boxes. If we select the currency codes of countries from the two combo boxes, two text boxes available in the right side of the page will be enabled. We can enter currency amount in one of the text box and the other will give the corresponding amount based on the conversion rate.


It is designed to guide development and design in ClaySys AppForms, including:

  • Creating the form
  • Form Design
  • Data Source configuration
  • Rules
  • How to use this template
  • Import tenant
  • Create a new web part page

Creating the form
Form Design

Folders are used to store and organize forms that have a logical association or relationship. To create a new form click ‘New Folder’ button on the toolbar of the designer.

  • On clicking the New Folder option, it will create a new folder and the name will be in the edit mode. You can type in the new name for the folder.


  • Then click on the ‘New Form’ link on the toolbar. Give an appropriate name for the form. Click ‘Save’ to save the form.


  • You can drag and drop controls format the styles easily.


  • ‘Check-In Form’ to save the changes and publish to get the completed form for the end user to use. A form must be checked-out to make modifications while all aspects of the form can be examined while checked-in

Data Source Configuration

Following steps will explain about the Data Source configuration of Combo Box.

  • Click on the Combo Box control and click the Data Sources tab to edit the Data Source.


  • A pop-up window appears to select the item source. Select the Item Source as ‘Static’ so that the values can be given as static.
  • Following figure shows the combo box in preview.


When you upload the form, Web service DataSource will automatically be added to “DataSource settings”. Following steps will explain about how to create a new WebService DataSource.

  • In the Data Source wizard on the left side of the designer, select the DataSource Type as WebService.
  • Enter the Title& Description for Web Service Data Source. This is mandatory.

Enter URL for the WebService. Example URL:


  • Username and Password are not required for this Public Web service. Select ‘Make it Public’ for the availability of created Data Source across all the sites. If its public, it will be available for all the site collections.


  • Select ‘Is SharePoint ‘for the UserProfile SharePoint WebService.
  • Click on the icon to insert or update the DataSource.
  • A message will pop up indicating the successful insertion of web service. Click ‘Ok’.
  • Following steps will explain how to configure the web service data source.
  • To create an external DataSource click on the ‘Create DataSource’ link on the left side of the designer.

Give the DataSource name and select the DataSource type as ‘Webservice’. Click ‘OK’ to continue.

DataSource configuration wizard with all the WebService datasource mapped will be populated. Select the ‘Currency Convertor’ DataSource from the available DataSources. Click ‘Next’ to continue.

Click ‘Add’ button to add the Select command. DataSource operation in webservice can be defined only for ‘Select’.
Select the DataSource object as ‘ConversionRate’. Click ‘Next’ to continue.

A sample SOAP request shows. Click ‘Next’ to continue.

Enter the control name for the selected DataSource object for XML request. In the request XML view, give the ‘FromCurrency’ as ‘cmbCountry1’ combobox and ‘ToCurrency’ as ‘cmbCountry2’ combobox .Click ‘Next’ to continue.
A sample SOAP response shows. Click ‘Next’ to continue.

In the response XML view, give the ‘ConversionRateResult’ as ‘txtConversionRateResult’ textbox. Click ‘Next’ to continue.
Data Source operation for ‘Select’ is now defined.

Once the Data source operation is defined, it is bound to a control or event that triggers its execution. It is given by ‘Add Trigger’ button. So that the corresponding Execute Command rules will be created with associated trigger.

We can add the trigger by clicking the check box corresponding to the control.

Click ‘Create Rule’ will automatically create the corresponding ExecuteCommand( ) rule for the select command associated with the trigger.

Click ‘Finish’ to save and close the data source configuration.


The rules section is the most powerful section in the AppForms. The rules can be configured using the Rules Engine. Following are the rules associated with the application.

The rule named ‘GetcurrencyConversionRate’ is basically the DataSource select operation of webservice. Based on the two conditions shown in the figure, the textbox controls can be enabled/disabled and the values of ‘ConversionRateResult’ are populated from the webservice also fills the values of ‘Equivalent amount’ label controls on comboboxes (‘cmbCountry1’ and ‘cmbCountry2’) trigger. This process is converted into concise, yet readily understood rule expression statements that represent the underlying execution logic of the form as shown in the figure.


The rule is named ‘CalculateToAmount’ gives an equivalent amount of money in ‘txtToAmount’, which is the multiplicative amount of ‘txtConversionRateResult’ and the ‘txtFromAmount’ on ‘txtFromAmount’ trigger.


The rule is named ‘CalculateFromAmount’ gives an equivalent amount of money in ‘txtFromAmount’ which is the divided amount of ‘txtToAmount’ and ‘txtConversionRateResult’ on ‘txtToAmount’ trigger.


 How to use this template

Import Tenant

Following steps will explain about tenant import.

Open the ‘Backup and Restore’ option in AppForms in the destination site and click on the ‘import site’ tab.

Select the backup file we had saved from the source site.Image32
Once the file is selected, click on the load button.

This will show you the different sites that were exported from the source site. If there are more than one site content saved, then you can map each site in backup file to different sites in the current site. Select the required site content that needs to be restored and select the destination site in the current site as shown below. Once we are done with the backup mapping, click on the next button to proceed with the import.

Now we will have to remap the sites we had used in the source website to the actual site in the target site. The dropdown will show you will the sites/sub sites to help you with the datasource mapping. Click ‘Next’ to continue.
Click ‘Import’ to continue.

This will import all the site content we had backed up from the source site and we are ready to work with the forms in the current site.

Create a Web Part Page

Forms can be embedded on any SharePoint page by using the ClaySys AppForms Web Part, to create a webpart page, follow these steps:

Click on Site Settings Wheel in the upper right corner of your site and then select “Site Contents Page”.


Select “Site Pages” or simply pages library on Site Contents Page.

Click on “New Wiki Page” to add new site page.


Give the New page name into the pop-up window and click ‘Create’ to add new page.

To add a new web part, click on the ‘Insert’ tab and then click on the ‘WebPart’ button. Then select Claysys -> Claysys HTML WebPart.

Click ‘Add’ button to add the Web Part.
Click on the ‘edit the Web part’ link to edit the page.

A new pop-up window appears and here we can configure the ClaySys AppForms by clicking on the ‘Configure’ button.


Pop-up appears with listed published forms. We can select the appropriate form by click on the form and add the form by clicking on the ‘Select’ button.Image45
Once the configuration is finished, click on the ‘Apply’ button to see the changes. Click ‘OK’ to continue.


Click ‘Save’ button to save the changes.


Below figure shows the form after Web Part configuration.


Vinod TharakanFounder & Managing Director of ClaySys Technologies.

Leave a Reply

Your email address will not be published. Required fields are marked *