Hypen in object property name

Hi All,

I am trying to return field from an API that have hypens in it (“email-address” & “company-name”). Please see my code below. I tried using JSON.Stringify and that didn’t work. Any ideas?

  name: "People",
  description: "List of people",
  identityName: "Person",
  schema: PeopleSchema,
  connectionRequirement: coda.ConnectionRequirement.None,
  formula: {
    name: "SyncPeople",
    description: "Sync people.",
    parameters: [],
    execute: async function ([], context) {
      let response = await context.fetcher.fetch({
        method: "GET",
        url: "https://accttwo.teamwork.com/people.json",
      let people = response.body.people;
      let result = [];
      for (let person of people) {
          id: person.id,
          name: person.name,
          company_name: person.company-name,
          email_address: person.email-address,
      return {
        result: result,
1 Like

Hi @Leo_Gutierrez2 - JavaScript doesn’t allow you to use hyphens in variable names or other identifiers, since it’s reserved for the mathematical minus operation. Instead you can use the array-like syntax to get that property from the object:


This does the same exact thing, but doesn’t violate JavaScript’s rules.

1 Like


Great to hear from you again. Thank you so much! This did the trick. I had tried that initially, but had left the dot as if were still an object. I’ll cancel the meeting request I booked you for on Wednesday. Have a great rest of your day.