Unexpected Result Encountered While Using Slice as Dropdown Source Data

Greetings Community,

I'm currently encountering an issue while utilizing Slice, and I'm hopeful that someone can guide me in resolving it. Here's a detailed overview of my situation:

I've been using Supabase (Postgres) as my backend database, and thus far, the experience has been satisfactory.

tableslice.jpg

  1. In my "contact" table, I've established a primary key [id] with the UNIQUEID() function. Additionally, there is a Boolean column named [is_active], which defaults to TRUE. This column is intended to signify whether a contact is currently active.
  2. I've created a slice named "contact | ACTIVE" based on the "contact" table. This slice incorporates a Row filter condition where [is_active] is set to TRUE. The purpose of this slice is to serve as the source data for a dropdown menu when adding a new invoice.
  3. Within my "invoice" table, I've defined the [id_customer] column as a Ref type, with the source table pointing to the "contact | ACTIVE" slice. I also have a Valid_if condition for [id_customer] to filter type of contact is equal to "CUSTOMER".
  4. The issue at hand arises when adding a new invoice and selecting a customer ([id_customer]) from the dropdown. Despite the [is_active] condition in the slice, the dropdown still displays the [id] of customers marked as "inactive."

dropdown.jpgโ€ƒ

I'm eager to understand what I might have overlooked. Could someone please assist?

 

 

Solved Solved
1 4 162
1 ACCEPTED SOLUTION

Please try using the slice name  in your valid_if expression in the i[d_Customer] column.

So instead of ORDERBY(SELECT(Contact[id].......)

please try 

ORDERBY(SELECT(contact | ACTIVE[id].......)

Side note: You may want to avoid special characters such as "|" in naming elements that will be further used in the expressions. You may instead want to use underscore"_". So the slice name could be "contact_Active" instead of "contact | ACTIVE". This will help avoid any conflict in parser while evaluating the expressions. As we are aware certain special characters have certain meanings. For example "-" is also used for subtraction.

View solution in original post

4 REPLIES 4

Please try using the slice name  in your valid_if expression in the i[d_Customer] column.

So instead of ORDERBY(SELECT(Contact[id].......)

please try 

ORDERBY(SELECT(contact | ACTIVE[id].......)

Side note: You may want to avoid special characters such as "|" in naming elements that will be further used in the expressions. You may instead want to use underscore"_". So the slice name could be "contact_Active" instead of "contact | ACTIVE". This will help avoid any conflict in parser while evaluating the expressions. As we are aware certain special characters have certain meanings. For example "-" is also used for subtraction.

Thank you so much for the provided solution and the helpful tips. It's now working as expected.๐Ÿ™

You are welcome. Good to know it works.

When I use AppSheet to connect to the Supabase database, I encounter an issue which is 'max client connections reached.'

The reason, as far as I understand, is due to the mechanism of AppSheet when performing CRUD operations asynchronously. Each time it does an async operation, AppSheet seems to async all tables on Supabase, leading to max connections being reached.

I've tried changing ports like 5432 and even 6543, but I still encounter similar errors. Has anyone on this forum encountered a similar situation and could share how to resolve it? 

Top Labels in this Space