Forms. How to output and process data on a form from an external source via the API

The form can show data from an external source. 

The form can send form data via the API and get a response when you click Save.

When you change the data field, you can call external sources via the API and output data to the form. 

To implement this, do the following: 

1. Specify the data sources in the form parameters GetItem API, SaveItem API, and CheckField API. You can specify multiple sources separated by commas. 

If the source is specified, API requests are sent before calling the corresponding procedure, and the result is passed to the stored procedures.

2. Create outgoing API requests that were specified in the form settings. The following parameters will be passed to the request procedure in their parameters: 

  • GetItem-passed itemID
  • SaveItem-all form parameters are passed
  • CheckField-passes the itemID, field (the changed field), and value (the value of this field)

3. In the GetItem, SaveItem, or CheckField procedures, extract data from the @parameters collection (Key,Value2). Key-code of the API request. 

CREATE PROCEDURE [dbo].[fm_tst-remoteform_getItem]
    @itemID int,
	@username nvarchar(256),
    @parameters ExtendedDictionaryParameter readonly

AS
BEGIN
	declare @text nvarchar(max)
    select @text = Value2 from @parameters where [Key]='falconUpdates'

	select @text text
END

Creating API requests is described in - Falcon Space. Creating an API service (incoming and outgoing API requests)

The value that falls into Value2 is the Response field from theresponse processing procedure - response of the corresponding API request. 

The Response field can contain both the full, raw response of the API request and the final results of parsing the response.

4. Use the received values in these procedures

In GetItem, you can initialize the form fields

In SaveItem, perform some API action (for example, pass the form fields and output the result). 

In CheckField, you can use the changed fields to extract some data from an external source, such as prices.

Note

Consider that the API call code must be less than 32 characters. 

 

Falcon Space Platform

This is a reduction in the cost of ownership

at the expense of fewer people to support

This is a quick change

while using the program

This is a modern interface

full adaptation for mobile devices

 
Note