Skip to main content
All CollectionsTips, tricks and troubleshootingUser case-specific guides
Using Form Actions to Call a Web Service with HTTP Request
Using Form Actions to Call a Web Service with HTTP Request

Learn to call web services in Yeeflow using HTTP request form actions for data retrieval and integration with third-party systems.

Updated over 10 months ago

Yeeflow allows users to integrate with third-party systems by calling web services via HTTP requests. With the HTTP Request step in Form Actions, users can easily retrieve data from external systems or post data from Yeeflow to third-party APIs.

In this guide, we will demonstrate how to create a form action that calls Yeeflow's Restful APIs to query data from a data list and display the result on an Approval form.


1. Setting Up the Form

To get started, open the form designer of an Approval form. Follow these steps to set up the necessary controls:

1.1 Adding Controls to the Form

From the left controls panel, drag and drop a Single line control onto the form. Change the Field ID to "field_ItemID" and the Field Name to "Item ID."

Next, add a Multiple line control to the form. Change the Field ID to "field_ItemContent" and the Field Name to "Item Content." In the properties settings panel of this control, expand the Validation group and toggle on the Readonly setting.

1.2 Adding a Button Control

Now, add a Button control to the form and set its display text as "Get List Item Data." Customize the styles of this button to match the form's design.


2. Creating the "HTTP Request" Form Action

2.1 Opening the Actions Management Window

Click the "Actions" button from the top-right of the form designer to open the Actions management window.

2.2 Adding the "HTTP Request" Form Action

Click the "+ New action" button to create a new form action. Change the name of this action to "HTTP Request."

2.3 Adding the HTTP Request Step

Click the "+ Add a step" button, and from the step type pop-up window, select "HTTP Request."


3. Configuring the HTTP Request Step

3.1 Obtaining the API URL

To query a data list item with its ID, we'll call Yeeflow's "Get an item by ID" API. You can find this API in the Yeeflow API documentation with the URL:

Copy the API method from the Get API method:

https://api.yeeflow.com/v1/lists/{appID}/{listID}/items/{id}.

3.2 Configuring the HTTP Request Step

Back in the form designer, expand the HTTP Request step's settings panel. In the HTTP Address field, click the editor icon to open the Expression Editor. Click the "Text" button from the top toolbar and paste the copied API method.

Replace the {appID} with the fixed value 41. The {listID} is the unique ID of the data list we want to query data from, and it can be found in the application settings page. For this example, we are going to use the "Task Management" data list to query one of it's item.

For the {id} parameter, we want to use the value of the Single line control "Item ID," so replace the {id} parameter with the workflow variable: "Item ID".

Click "OK" to close the Expression Editor window.

From the Method dropdown list, choose "GET." For the Authentication info, select "Yeeflow build-in HTTP Service."

Next, from the Result field, select the "Workflow variable: Item Content" to save the returned value to the Multiple line control we added before.

Click the "Save" button to save the settings of this HTTP Request step.


4. Binding the Action to the Button

Select the "Get List Item Data" button from the form to open the properties settings panel. From the Content tab, expand the Action group, and select the "HTTP Request" action from the dropdown list.


5. Testing the Functionality

Now, you can click the Preview button to test the function. Input the desired List Item ID in the "Item ID" text box. The item ID can be found from Id field of each data item.

Then, click the "Get List Item Data" button. The data of the queried item will be displayed in the "Item Content" text area control.


With Form Actions and the HTTP Request step in Yeeflow, users can seamlessly call web services, access external data, and integrate with third-party systems. By leveraging this powerful feature, organizations can achieve enhanced data tracking, better integration, and improved workflows within their Yeeflow applications.

Unlock the potential of Form Actions and elevate your automation capabilities with Yeeflow's versatile platform.


โ€‹

Did this answer your question?