Once you connect at least one data source, you can manage the resources and functions associated with that source. You can also adjust how you want to sync the data source, and change connection details as well.
Click on Company Settings → Data Sources to manage your data sources. You can add a new data source or view the function library. Click on a data source to bring up a panel to manage its settings.
Click “View” to see your current connection settings for this data source. You can make changes here - click “Save” after you’re done.
Click “Sync” to start a manual sync of the data from your data source into Internal. This will update the schema and associated data changes.
Click “View” to see more details about your sync history, and to change your sync from “Automatic” to “Manual”. If set to Automatic, Internal will sync the data source daily (at the time shown). On Manual, Internal will only sync when you come to this page and trigger a manual sync of your data.
Resources refer to the datasets contained within each data source, like a table within a database, the Organizations data from Salesforce, or the Tickets data from Zendesk. Ex: Your PostgreSQL database contains a Customers table and an Orders table; both of these tables are resources.
Resources are generated automatically where possible, and you can also define your own custom resources using SQL. When you connect a database, a resource is generated for each table in that database. When you connect a business app, resources are generated based on the specific app. Ex: Salesforce will generate “Deals”, “Contacts”, “Organizations”, while Stripe will generate “Charges”, “Refunds”, etc. Check out the documentation for a specific data source to see what’s generated automatically.
Click “View” to see a list of the resources contained in this data source. You’ll see the name of the resource on the left (coming from your data source), and the display name on the right, which you can update. You can also expand each resource to see the individual fields (columns) within each, and update the display names for each field. In addition, you can use the checkbox to choose what field(s) should be the primary key(s) for this resource.
A primary key is a field (column) whose data uniquely identifies each row in the table. Often, these fields are IDs, like a user ID or customer ID, but can also be uniquely identifying fields like email addresses. Internal displays the primary key by default in the first column, and defaults the primary key as the header in the record view of a resource.
Create a new resource
You may want to create your own custom resource, using fields that come from multiple existing resources. For example, you may want to create a resource that uses the “Company Name” from your Companies table and the “Order Amount” from your Orders table. You can do this by populating the data with a SQL query (a custom SQL resource).
Functions let you perform various actions on your data. You can manage and create functions here (within Data Sources), and then connect your components to functions in Spaces. A function can update a specific record, bulk update multiple records that fit a certain criteria, or even call an API endpoint and pass parameters.
When you connect a database, basic CRUD functions are generated automatically, allowing you to insert, update, and delete a single record. These functions will appear as long as the credentials used to connect to the database have these privileges. Connecting a business app will generate similar CRUD functions. Check out the documentation for a specific data source to see what functions are generated automatically.
You’ll see buttons to “Add New” and “View”: these apply to custom functions you can create (see below). You won’t see auto-generated functions in the function library.
In some cases, you may want a function to act on more than one record (bulk update). You can do that by creating a custom function for a database.
Internal also gives you the ability to create functions from your existing APIs or graphQL mutations. This can greatly extend the functionality of the tools you build. To do this, you can create a custom function for a HTTP data source.