[SOLVED] "data should not be an IEnumerable/List/Collection" error in a Content Changed rule to Populate Algolia Index

I have…

  • [X] Checked the logs and have uploaded a log file and provided a link because I found something suspicious there.

I’m submitting a…

  • [ ] Regression (a behavior that stopped working in a new release)
  • [X] Bug report
  • [ ] Performance issue
  • [ ] Documentation issue or request

Current behavior

I’m trying the “Content changed” rule to populate the Algolia index but I’m facing some issues. The rule is like:
image
And the configuration of “Populate Algolia index”:


When the rule is run, this error is thrown:
image

Expected behavior

The rule is executed without errors and the content is created in Algolia.

Minimal reproduction of the problem

  • Having an Algolia instance up and running.
  • Having a “Content changed” rule configured with the action “Populate Algolia index”.
  • Configure the Application Id, API key and index name in this action.

Environment

  • [ ] Self hosted with docker
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [X] Cloud version

Version: [VERSION]

Browser:

  • [X] Chrome (desktop)
  • [ ] Chrome (Android)
  • [ ] Chrome (iOS)
  • [ ] Firefox
  • [ ] Safari (desktop)
  • [ ] Safari (iOS)
  • [ ] IE
  • [ ] Edge

Others:
When the rule is executed form the simulator, it seems to work:
image
Also, I’m not sure whether an explicit JSON transformation is needed in the “Document” configuration section in the “Populate Algolia index” action, something like:

JSON.stringify(
    {
        "id": "$event.data.id.iv"
    }
);

I have pushed a potential fix, but I havent had the chance to test or deploy it yet and will not have it today.

Many thanks @Sebastian for this quick fix! Don’t worry too much about the timing, if it can be deployed the next week, it would be great :wink:

I have tested it and it works.

Thanks for the update @Sebastian, so is the solution already deployed?

This topic was automatically closed after 2 days. New replies are no longer allowed.

Not yet, I will keep you updated.

1 Like