Algolia integration reference problem

Hi,

I have the following custom document in a Rule that gets triggered on Updated:

Liquid(
{
	"id": "{{event.id}}",
"status":"{{event.status}}",
{% for brandId in event.data.make2.iv %}
   {% reference 'brand', brandId %}
   "brand": "{{brand.id}}"
{% endfor %}


}
)

This particular line is not working:

"brand": "{{brand.id}}"

I’ve tried several combinations; none of them give me any values from the referenced content. brand.id would be the simplest scenario but it does not work.

Data structure:

{
  "data": {
    "queryProductContents": [
      {
        "data": {
          "make2": {
            "iv": [
              {
                "data": {
                  "name": {
                    "en_US": "Brand 1",
                    "sv_SE": null
                  }
                }
              }
            ]
          }
        }
      },
      {
        "data": {
          "make2": {
            "iv": [
              {
                "data": {
                  "name": {
                    "en_US": "Brand 2",
                    "sv_SE": null
                  }
                }
              }
            ]
          }
        }
      },

What am I missing?

This is how it looks in Algolia:


I’ve checked the following docs:

https://docs.squidex.io/02-documentation/developer-guides/rule-formatting/liquid#reference

I’m using squidex/squidex:5.5.0

I’ve tested recreating the rule since I read in some forum post that in some older version there were some caching issues.

Btw, if you think make2 looks weird that is the correct field name. I just have another one that is called make that is an old/deprecated field.

Also, both the parent and child (referenced content) contents have status Published.

Works fine for me:

It has nothing to do with algolia, though. Is everything published?

Yes, everything is published.

I don’t have the three tabs Text, Fluid, and Script in my version of Squidex 5.5.0. Maybe something got fixed after that version?

Perhaps, but it is just syntax sugar for your Liquid( ) thing

Yes, that was my understanding as well.

Will try with some other Squidex versions. Hopefully I won’t need to upgrade to version 6 or 7 I believe is the latest one?

Did some more testing in Squidex Cloud environment and it works there.

So I think I will have to upgrade from 5.5.0.

For reference and for my future self:

"brand": "{{brand.data.name.iv}}" (works)

"brand": "{{brand.data.name2.en}}" (works)

"brand": "{{brand.data.name2.sv}}" (does not work)

"brand": "{{brand.data.name2.sv_SE}}" (does not work)

"brand": "{{brand.data.name2.svSE}}" (does not work)

"brand": "{{brand.data.name2.sv-SE}}" (works)

"brand": "{{brand.id}}" (works)
1 Like

I updated Squidex from version 5.5.0 to 5.9.0 and this fixes it.

Thanks Sebastian for all the support!

1 Like