Overview
API Type Model solely focuses on integrating with external web applications by using REST APIs, allowing seamless data retrieval and management from various web sources.
These models handle data exchange and can be bound various components, enabling efficient data display and interaction across various layouts.
Before heading to this section, we need to have some basic understanding about API connections. Let us go through that first.
Pre-requisites
Auth Provider Salesforce Help: https://help.salesforce.com/s/articleView?id=sf.sso_provider_sfdc.htm&type=5
Auth Provider Trailhead: https://trailhead.salesforce.com/content/learn/modules/identity_external/identity_external_social?trail_id=identity
Named Credentials Salesforce Docs: https://developer.salesforce.com/docs/platform/named-credentials/guide/get-started.html
Named Credentials Trailhead: https://trailhead.salesforce.com/content/learn/projects/quick-start-create-http-callouts-with-flow-builder/create-the-credentials
Connected App Salesforce Help: https://help.salesforce.com/s/articleView?id=sf.connected_app_create.htm&type=5
Connected App Trailhead: https://trailhead.salesforce.com/content/learn/projects/build-a-connected-app-for-api-integration/create-a-connected-app
This will give an idea about Auth Provider and its configuration, Named Credentials and its configuration as well as Connected App for OAuth settings. Also, if you want to completely go through this you can refer:
References:
Named Creds Blog: Connecting with external application using Rest API
REST API Configuration: REST API Configuration - noKodr-For Salesforce
In this section, you can see various option while creation model for API types let’s understand each:
Let’s explore the screens that follow, after clicking on Model Creation
+
button andType
asAPI
.
Details
In this tab, user can specify the REST API Connection for integration and its details, on whose basis model is to be created.
Details Config | Description |
---|---|
Type | Allows to specify the type of model, such as:
Note: By default, |
Authentication Type | Allows to specify flexible and secure access to integrated applications through following options:
|
Connection | Provides the ability to specify the source (i.e., from various web applications to be integrated with REST APIs) to select records . Note: This field is only visible when |
Label | Allows to specify the name of the model. Note: In case of |
Name | Allows to provide unique API name for the model. Note: In case of |
Execute on Load | Enables records to be fetched automatically upon loading the component. |
Request
In this tab, user can specify the REST API request that is sent to a server to access resource data.
Request Config Group | Config Name | Description |
---|---|---|
Request Parameters | Method | Allows to specify HTTP method among different HTTP methods such as GET, POST, PATCH, etc. are used to perform specific operations on resources. You can explore more about methods by clicking here. Note: By default, |
URL |
Reference: Merge Text | |
Is Array? | Allows to specify whether the data retrieved from resource should be treated as a single record or multiple records (an array). Notes:
| |
Type | Allows to specify type of query argument which will passed to URL, which is basically of two types:
Note: When | |
Request Body | Generate Schema | Allows to define object JSON schema which will be passed on to request. Reference: Schema Designer |
Create New Field | Allows users to create fields that can be utilized to build an object JSON schema. Reference: Schema Designer |
Response
In this tab, user can specify the REST API response that is sent by a server with resource data.
Response Config Group | Config Name | Description |
---|---|---|
Response Parameters | Status Code | It indicates whether a specific HTTP request has been successfully completed. |
New Button | It allows to specify new Status Code as per one's business need. | |
Record Count | Set the record count to either Multirecord or Single, depending on whether you are dealing with multiple records or a single record in the data operation. | |
Response Body | Generate Schema | It can define fields using JSON format. Reference: Schema Designer |
Create New Field | It can create fields using the create field Model. Reference: Schema Designer |
Merge Text
Merge Text
Merge text is a key feature of the noKodr application, allowing users to display field values on the UI. Depending on the data type, users can perform mathematical operations on these fields.
For example, if you want to display a calculated total price based on the quantity and unit price entered by the user on a sales order form, and you wish to dynamically showcase this on the UI without saving the record in the database, you can achieve this using the UI fields in noKodr.
After selecting merge text you can you can see several options such as:
Attribute Name | Description |
---|---|
Source Type | In this option, you can select various sources from which you want to display values. |
Value | The available options will change depending on the selected source type. For example, if you choose "Static" as the source, you can provide a fixed static value. |
Merge Field Expression | The selected field from the source will be displayed in a merge format. For instance, the first name field from the contact model will appear as: {model:contact.FirstName}. |
Message Body | In this option, You can add multiple values to form your final UI merge text. For example, merge fields include {model:contact.FirstName},{model:contact.LastName} will eventually display the contact's first name and last name next to each other. |
Available Sources
After clicking on the Gear Icon, you can select various sources to include fields or values, such as variables, other models, static values, etc.
Source Type | Description |
---|---|
Static | Use this option to provide a fixed static value. |
Field | Select the field from the chosen object in the model whose value you want to include. |
Model | Choose the field from other models whose value you want to include. |
Variable | Select from the variables created in the layout whose value you want to use. |
Cookie Key | Choose the available cookie key whose value you want to include from your browser. |
Local Storage Key | Select the available Local Storage Key whose value you want to include from your browser. |
User | You can also select fields from the current logged-in user in your organization to include in the merge. Note: The User source refers to the currently logged-in user in your organization. This means that if you include the First Name field from the user, each time a different user logs in, they will see their own First Name displayed. |
After selecting the source type, you need to choose the available options based on the selected type. For example, if you have selected "Model" as the source type, you will need to select one model from the available models.
Note: Only single record models are visible here and can be used in the merge text. Multi-record models are not supported here.
Once you select a model, the field options will become available. You can then choose the fields you want to include in your merge field expression and combine multiple fields to form your final expression in the message body.
Schema Designer
Generate Schema
A "generate schema" typically refers to the process of defining or creating a structured format that outlines how data is organized, validated, and transmitted, especially in contexts like APIs or databases.
In noKodr, users can define fields using JSON format.
Button | Description |
---|---|
Cancel | It allows the user to exit the "Generate Schema" process. If any changes were made in the modal, they will be discarded, and no new schema will be generated. |
Recreate | It is used to reset the schema creation form within the modal. All fields will be cleared or set to their default values, enabling the user to begin the process of defining a new schema from scratch. |
Merge | It allows the user to merge the newly generated schema with an existing schema. This is useful when the user wants to integrate new schema elements into a pre-existing schema without completely overwriting it. Reference: Schema |
Create New Field
In cases where a user does not have data in XML format but has it in JSON format, the application allows the user to create a schema by adding new fields directly.
This feature is particularly useful for users who need to generate or modify schemas based on their JSON data structure.
Field Config | Description |
---|---|
Name | The identifier for the field within the schema. This is the name that will be used to reference the field in the data structure. |
Type | It specifies the data type of the field. Note: By default, field type is text. Reference: Field Type |
Required | It indicates whether the field is mandatory. |
Minimum Length | It defines the minimum number of characters or elements that the field must contain. |
Maximum Length | It defines the maximum number of characters or elements that the field must contain. |
Pattern | It is a regular expression that the field’s value must match. This is typically used for validating formats like email addresses, phone numbers, etc. |
Help Text | It provides additional information or guidance on what the field represents and how it should be used. This is often displayed in the UI to assist users. |
Default Value | It is a predefined value that the field will take if no other value is provided. This helps in setting initial values. |
Schema
Field Type
Field Type | Description |
---|---|
Array |
For example, A list of user roles in a system: |
Checkbox |
For example, A |
Date |
For example, |
Date and Time |
For example, |
Double |
For example, |
Integer |
For example, |
Object |
For example, |
Text |
For example, |
Add Comment