Skyvia Connect allows configuring OData entities of your endpoints in both Simple and Advanced mode. You can change the generated names of entity types, their properties, and entity sets. Additionally, you can exclude data source columns from entities so that they were not available via the endpoint.
To edit an entity, click the Edit Entity icon. In the Simple mode, this icon can be found near the selected checkbox of the corresponding object. In the Advanced mode it is located in the header of an entity shape on the diagram. It opens the Edit Entity dialog box, displaying entity naming parameters and a table with entity fields with the information about them.
To delete an entity from the endpoint in the Advanced mode, click the Delete Entity button in the entity header. In the Simple mode simply clear the corresponding object checkbox.
Entity and Property Naming
By default, the entity name is generated based on the source table/object name. If the source table/object name is a plural form, it is singularized. The entity set name is generated by pluralizing the source table/object name if necessary. If the source table/object name contains characters, not allowed in names by OData standard, they are omitted. If the generated name coincides with an OData keyword, underscore characters are added on both sides of the name.
If the default names don’t suite you, you can edit the generated Entity Name and Entity Set Name in the Edit Entity dialog box. Yo can also specify the data source table to expose data from via this entity in the Source box.
Property names are also generated by removing characters, not allowed in names by OData standard, from the underlying column/field names. You can view the source column/field names in the Source column of the grid. If necessary, you may edit the generated property names in the Name columns.
This can be useful, for example, if the source has too long field names, and you want to create an OData endpoint for linking the source to Salesforce Connect. Salesforce Connect truncates property names over 50 characters, and sometimes this may lead to errors when two property names in the same entity are truncated to the same 50-character string.
Entity key is a set of properties, uniquely identifying an entity instance. Each entity must have an entity key. By default, it is generated from the primary key of the underlying database table, or id field of the underlying cloud object. The Edit Entity dialog box displays properties, included to entity key, with a key icon in the Key column.
However, you may need to generate an OData entity from a database view or a BigQuery table, which does not have a primary key. If necessary, you may customize (or create) an entity key manually. Just click the Key column for the necessary entity properties to toggle their key status.
Please note that we don’t check if the custom key you define is truly unique and non-nullable. If you customize an entity key, you should care about this yourself. Using a non-unique or nullable entity key may lead to errors when working with the endpoint data. For example, if you request an entity by an entity key value, and this value is not unique in the data source, you will get the “Operation is not valid due to the current state of the object.” error.
Excluding Source Fields from OData Endpoint
If you don’t want some source fields to be available via your OData endpoint, you can easily hide them in the Edit Entity dialog box. For this, select properties that you want to hide by clicking them and using Ctrl or Shift keys and click Hide. To add a hidden field back to the entity as a property, select it and click Show.
If you hide a non-nullable source field, which does not have a default value, and its value is not autogenerated in the source, you won’t be able to add new records to this entity via this endpoint.