Sort data using an external array

Hi everyone,

I’m currently utilizing an external API designed to support my application. The API receives an array of weights as input, which is obtained from a field within a table. It then generates a random number for each weight value, multiplies this number by the corresponding weight, and returns the ordered list of values.

Here is the output from the API:

At this point, I am unsure of how to proceed with sorting my repeating group using this array. Is it possible to do so?

See:

This can also be done in Floppy:

Thanks @keith, but how to prevent this?

http://forum.bubble.io/t/how-can-i-use-merged-with-but-keep-duplicates/214469/5?u=keith

1 Like

@keith ,

I apologize for bothering you again. I have successfully initialized the plugin, but unfortunately, it’s still not functioning as expected. Please find my settings below:

And this is how my RG is setted:

My API is passing a list of numbers to the plugin that represents the ranks of the data objects, but the plugin is not sorting them accordingly. I have attached a repeating group, and the number in bold represents the current weight of the object.

However, the most heavily weighted object is not at the top.

Could you please let me know where I’m going wrong? Thank you for your assistance.

Great news, it appears to be working now!

I realized that I was implementing an additional sorting criteria, which was causing the issue.

Yep that would mess that up. Glad you got it “sorted”.

Had har har, see what I did there?

But, seriously, yeah the order of the original list must match the order represented by the sort source list or you’ll not get the correct sorted output.

Pro tip: remember that List Shifter is Karma-Ware. GRUPZ: Karma-Ware Plugins for Bubble

1 Like