Improvements to column names and the CLI in Packs SDK 1.7.5

Our latest release of the Packs SDK allows you to create better sync tables and test more of your code locally. Keep reading to learn how you can leverage these features in your own Packs.

Column display names

The column names in a sync table arise from a somewhat roundabout process:

  1. You define property keys in your schema
  2. Coda transforms them into property names appropriate for the formula editor
  3. Coda then transforms those into a human-readable column names

While all of these automatic transformations are convenient, they can occasionally lead to some odd columns names. For example: iPhone_versionIPhoneVersionI phone version.

To give Pack makers more control over their column names we’ve introduced a new field, displayName, that let’s you explicitly define what the column name should be for that property:

iPhone_version: {
  type: coda.ValueType.String,
  displayName: "iPhone version",
},

This feature is especially useful for sync tables that use dynamic schemas to sync custom fields, as those fields often have names that contain punctuation and other special characters that can get lost in the normal transformation process.

Screen Recording on 2024-03-12 at 04-07-19

You can learn more about the displayName field and how to use it in the Schemas guide.

Executing metadata functions locally

While the majority of the code in a Pack is contained within the execute function of the building blocks, there can be a fair amount of other code scattered about that generates important metadata. For example, an autocomplete function of a parameter, or the listDynamicUrls function of a dynamic sync table.

Previously there was no easy way to run and test this code when developing locally using the Packs CLI, but in this release of the SDK we’ve extended the coda execute command to support these metadata functions as well.

For example to execute the autocomplete function of the greeting parameter in the Hello formula you could run:

npx coda execute src/pack.ts Hello:autocomplete:greeting

To fully test the code you can pass a search string and the value of other parameters as additional command line arguments.

Screen Recording on 2024-03-12 at 03-52-27

To learn more about this feature and how to use it to test other types of metadata functions refer to the Using the CLI guide.


If you have any questions or comments about these features, or have feature requests you’d like us to know about, drop us a comment below.

10 Likes

Very cool! Amped to start using that displayName property!

2 Likes

Hi, @Eric_Koleda .
Does it mean that when I cross-doc a table, column names won’t change when I use special characters?

Just updated Airtable, Notion and Webflow Packs to use the new displayName property for dynamic sync tables :slight_smile:

2 Likes

We’re planning to fix cross-doc to use this displayName feature soon!

2 Likes

Thank you!!! I use AirTable for my Pack Explorer!

1 Like