Lists of Ref: Is this a bug?

I 'm not sure I can explain this clearly, but I will try.

I have three tables. For the sake of this example, let's say that one is a list of [Customers], with their contact information. the I have  a list of [Inventory], with information about the products.

I have  a third table of [Orders] which "joins" this information, which contains a ref column to the [Customers] table and  a ref column to the [Inventory] table.

What I need to do is view a list of associated Customers in the inventory table,  to see who has ordered this product.

I used the following expression: SELECT(Orders[CustomerID], [ItemID]=[_THISROW]).

when I test this function, it gives me exactly what I want, a list of Customer IDs that have ordered this product. However, when I view it in the app it pulls up the entire list of customers. For example, it says "Associated Customers: 5  " but then displays all 100 customers, not just the 5 who are associated with the product.

 

Is this a bug in Appsheet, or am I doing something wrong?

Happy to clarify anything.

 

0 5 163
5 REPLIES 5

Could you share screenshots of your expression results and also the wrong view?

I made a sample app to display the problem.

There are three tables: 

1. Customers: a list of customers

2.Products: A list of the products

3. Orders: This "joins" the customers with a product, with a ref column to each other table. 

Like this:

EliK_0-1646166524197.png

 

What I need to do is make a "Related Customers" column in the Product table, which will show the information of the customers who have ordered each product.

I used the following expression:

SELECT(Orders[Customer ID],[Product ID]=[_THISROW])

Which evaluates to:

The list of values of column 'Customer ID' ....from rows of table 'Orders' ....where this condition is true: ((The value of column 'Product ID') is equal to (The value of column 'ID'))

When I test the expression, it works exactly as it should:

EliK_2-1646167009715.png

 

 

This should give me a list of key values of customers who have ordered the product. And in the inline view, it shows "Related Customers 3", which is the correct number. But the inline view displays all of the customers, not only the ones who have ordered the product!

Here is a picture of the problem. It shows that related customers are only 2, yet it displays the entire list of customers:

EliK_1-1646166857661.png

Can anyone help me with this, either to show me a different expression that I should be using to directly reference the two tables, or any advice to fix this problem?

Thanks!

 

What do you have for these settings in your column?

Marc_Dillon_0-1646167297228.png

 

 

I have it set to be a list with a base type of ref:

EliK_0-1646167735040.png

 

UPDATE: It was in fact a bug in the way a SELECT expression operated in a Ref-type column.

Appsheet support fixed the bug.

Top Labels in this Space