Using Visibility comparing 2 lists

I have a column in my User Table where users can select multiple attributes from a Choice Component (attribute1, attribute2, attribute3) to add their their profile.

I have Items Table where each item also has a column for attributes that were selected from a multiple choice component (attribute1, attribute2, attribute3, attribute4 and attribute5).

I want to display a component using a Visibility setting only when the Items attributes contains one or more of the User’s pre-selected attributes.

If ItemAttributes includes User → UserAttributes, display.

Problem is, I’ve tried to use Split Text, Joined Text, Make Array on both columns in each Table but seems like it has to contain ALL attributes as the component isnt showing.

Any tips?

Convert both lists into a single array (I’m sure you know how to do that), and then run that array through the Duplicated Items plugin. If it returns anything, then you have overlapping items.

OK thanks, I think I got it… could you tell me if there is a more efficient way?

On Items Table:
Single Element Array → User Profile → Attributes
Single Element Array → ItemAttributes
Append Array → 2x Single Element Arrays
Joined List → Append Array
Split Text → Joined List
Duplicate Array → Split Text

This has provided me the duplicates between the User Attributes and Item Attributes.
The Visibility on the component would be “If Duplicate Array is Not Empty”

I would do:

In your Items table:

  • Split Text Column, targeting User Profile → Item Attributes
  • Split Text Column, targeting Items → Attributes
  • Make Array column, combining the previous two columns
  • Find Duplicates, targeting the Make Array column

Perfect, thanks! I always forget about these Plugins!

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.