Random sort Add-on decorators

Options
I'm trying to random sort a couple table reference fields in my queried table. I believe I have the add-ons setup correctly with random sort, but when I query the main table (with the add-on decorators) it returns the json in order. This makes sense for the "boards" themselves, but I would expect the "Tops" and "Bottoms" to be returned randomly within each JSON object?


[Screen Shot 2021-09-09 at 9.54.24 AM.png]
[Screen Shot 2021-09-09 at 9.54.41 AM.png][Screen Shot 2021-09-09 at 9.55.00 AM.png][Screen Shot 2021-09-09 at 9.55.50 AM.png]

Comments

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
    Hey Andrew - just want to make sure you got your answer during office hours today?
  • Andrew -1831384
    Options
      - Thanks yes it did help me immensely. I'm really interested in exploring that match score idea further. One thing I ran into though and this is probably because I was only randomize 3 records, but sometimes it produced a duplicate "board" one after another (Sean ran into this in the beginning by coincidence). Is there anyway to prevent that? Using conditions? Or some other way? Thanks again for your help.
  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
    I apologize I don't have the full context as I was in a breakout room during this part of office hours... But perhaps set a unique index on your DB table and include the combination of fields that you wish to be unique (ie tops, bottoms)