Skip to content

Key Scraping

When a record is created inside of a system, the Central engine can retrieve the new key generated for that record. Central will then save that key inside its database to be used for any subsequent call to update that record. This is referred to as indexing the record. Keys that have been scraped and stored inside of an index can also be used as a cross-reference on Foreign Key Maps. See Maintain Index for information on managing indexed records.

Endpoints with key replication configured display a icon on their endpoint card in the Data Hub.

Key Scraping Action

InputDescription
Key ScrapingTitle: A freeform label you give to the Action.
Key Name: The name that the key is given inside of the index. The default value is ID; however, you are able to give the Key a more specific name. Indexed keys can also be managed manually in Maintain Index.
Key Source: Connectors (directing it to look in the save response for the key) and Response Headers (directing it to look in the response headers for the key).
Connector Property: If the source is a Connector, it will be a path to the property of the key, e.g. "ID." If the source is Response Headers, it will be a path to the specific header that holds the key, e.g. ..Location[0]
Transforms: Allows you to transform the response data the key in Central is returned to Central.
Other Key Sources: Allows you to instruct Central where to find the key in a response if there is an atypical response body after a save.

Edit or Delete the Primary Key Action

  1. Select Build > Data Hubs from the main menu.

  2. Select the appropriate Data Hub; then, select an Endpoint to edit.

  3. Ensure the Data Source tab is selected.

  4. Select the On Save tab from the Events column.

  5. Then, use the below table to determine next steps:

Edit the Primary Key Action

  1. Select menu > Edit in the ObtainPrimaryKey card.

  2. Enter a Title.

  3. Select a Source.

  4. As needed, toggle Requires Load.

    TIP

    The Requires Load toggle allows Central to query the system to find the record's key that was created if it is not in the response.

  5. Enter a Connector Property.

  6. As needed, select the arrow to add Transforms.

Delete the Primary Key Action

  1. Select menu > Delete in the ObtainPrimaryKey card.
  2. Select OK to confirm.

Obtain Child Primary Keys

The Obtain Primary Key action above scrapes a single key for the record being saved. When a save writes an entity and its child/line items in one call (e.g. an order with its lines), you need a key back for each child so those children can be updated later. Obtain Child Primary Keys is the key-extraction method for that case.

Add it from the parent save action's ⋯ menu > Add Action > Obtain Child Primary Keys Action. It is offered only when the entity has a list property and the connector is an API Call. The action scrapes a key for every item in a list and matches each key back onto the correct model child.

InputDescription
TitleA freeform label you give to the Action.
List PropertyThe list on the model whose items receive the scraped keys (e.g. OrderLines).
SourceWhere the keys come from: Connector (the save response body), Response Headers, or Central.
Data Selector(Connector / Response Headers) Path to the list in the response that holds the child keys.
Requires Load?Toggle on when the keys are not returned in the save response — Central then issues a follow-up read to fetch them. Exposes Read Method and Read URL.
After Child Configs?Runs this extraction after child config saves rather than before. See Execution order.
Connector PropertyPath to the key value on each list item.
Connector Match Property / Model Match PropertyThe pair used to match each scraped key to the right child item — the connector value is compared against the model property.
Match by OrderInstead of matching on a property, pair items by position (first key → first child, etc.). Use only when both lists are guaranteed to be in the same order.
TransformsTransform the scraped value before it is stored as the key.

Matched keys are indexed the same way as a parent key, so subsequent updates and Foreign Key Maps can resolve each child record. See Maintain Index to review stored child keys.

See Also

TeamCentral Admin Web Documentation