[SOLVED] Algolia Rule throws exception

Hi @Sebastian

I am getting the following error when pushing updated content data from Squidex to Algolia

data should not be an IEnumerable/List/Collection

Error: data should not be an IEnumerable/List/Collection

Elapsed 00:00:00.

PFA the relevant screenshots

Fixed and deployed to the Cloud

1 Like

@Sebastian this is working now. I have tested it. But I am getting empty data for reference fields in Article Schema. Articles Schema has 3 reference fields i.e author, hashtag and subcategory.

I have used the below code in the document payload to pass event data values for Article Schema in the Action on trigger of an updation of an article

Script(JSON.stringify(
   {
    "title":`${event.data.title['zh-TW']}`
     "body":`${event.data.body['zh-TW']}`
     "slug":`${event.data.slug.en}`
     "author":`${event.data.author['zh-TW']}`
     "hashtag":`${event.data.hashtag['zh-TW']}`
      "subcategory":`${event.data.subcategory['zh-TW']}`
    }
))

and I am getting the following output in Algolia

The red ones I am unable to populate because the are reference fields. Can you please help me correct the syntax for reference fields

It is not possible with scripts, but please use another thread for more questions. One thread per question, please.

1 Like