Dynamically lookup values from a field in another list?

I have a list of J things.
One of the fields in J is a P thing. P things have a text field, “name”.
Multiple J’s can have the same P.

So, if I were to list out my J’s by P’s name, I might get something like:
P name 1
P name 2
P name 1
P name 3
P name 2

I have a different list of M things. An M thing contains a P thing as well as a “value” field, and some other fields. This “value” field is essentially the value of P. These M’s are all unique, no duplicates. For example, my list of M things may have P’s name and “value”'s like:
P name 1, value 5
P name 2, value 7
P name 3, value 9

What I’d like to do is take my list of J’s above, and with each J, use J’s P’s name to search through M things to extract the value field from M.

So using my above examples, I would get a result like:
P name 1, value 5
P name 2, value 7
P name 1, value 5
P name 3, value 9
P name 2, value 7

I understand how to do this with one thing, but I’m struggling to figure out how to do this with a list of things, especially when my list of J things contains duplicates.

My current 2 thoughts:

  1. I can imagine using RG to get the job done with lists, but what I’m ultimately trying to create is a JSON array of values to send out to through an API to plot.ly. So… might there be a way to create this using RG, and then extract the result from the RG to feed into a text string?

  2. @mishav It seems like using List Item Expression from the Toolbox plug-in would get me there, but I’m finding I’d need to use a field("") in a search constraint, rather than in the body of the element—I’m not sure how/if that would work.

Help? Advice? Thanks! :slight_smile:

I’m still not sure how to solve this specific problem, but I just changed my data structures around so I wouldn’t have this problem.

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