Help using aggregates error sum() run()

  1. I’ll assume you import wixData, If not - you should do it
  2. I’ll assume you call this function from $.onReady and inside dataset.onReady if the text is retrieved from data collection. If not - you should do it.
  3. You’re using field labels instead of field keys. Field key never starts with a capital letter.
  4. No need to use ‘export’.