How can I load unique field(table) values into dropdown list

Hi,
I have an order table containing records of different items.
Each record has a field containing order number. The same order number can be in several records/order lines.
Is it possible to pull all unique order numbers and use them in a dropdown list?

The goal is to choose one order number and populate all belonging order lines in a list/embedded table.

How I imagen it could work.

  1. Get unique numbers
  2. Put them in a text arrey variable
  3. Use this variable as input to the dropdown list.
  4. Populate list

Hello @oviland!!

That’s a great question, and there are several ways to approach it.

1. Tables API

The Tables API (https://support.tulip.co/en/articles/3983173-how-to-use-the-table-api :link:) can be used to get all records in a Table. You can then use the returned array to populate the options in a single select that can be populated from a Text Array (see Options & Variable fields on the Widget tab):

2. Create an ID Table

Create another Table with the unique ID’s of the Orders, and use that to filter the Order Details Table. Something along the lines of:

Display both the Order Details and Order ID tables in an app, link a Record Placeholder to the Order ID Table & add a trigger to store the selection in a Variable:


Filter the Details Table with the Order ID (on the Order ID field):

This is the result of this app:

Do either of these approaches work for what you’re trying to build??

Would you like to join office Hours this Thursday at 11AM EST (https://community.tulip.co/t/tulip-office-hours-10-15/791)?? It would be a great topic to cover. Let me know if this is of interest to you and I can add you to the invite!!

Gio

Thank you for your quick response @gio

Solution 1
Can you use the API to connect to a Tulip table?
All my data are within Tulip (at the moment)

Solution 2
I think I can use this solution. But instead of using Order Number, I can use a Ship-To field, which does not alter in the same degree.
The only problem here is that I would like to only show “Ship-To” that has waiting orders (but it can be accepted without this feature)
It is not an option to manually maintain a Unique order table.

Is there no way to pull/list unique field values from a table, or is this where the API solution comes in?

An option in an embedded table for “Only list unique”, based on a chosen field, would be handy.

No problem @oviland!!

Yes you can. You can create a Connector to your own instance, create a function that points to the specific Table you need to pull information from, and use it from your apps.

While there is not a way to filter out duplicates directly in using the API, you could iterate through the records and remove any from the array that are already present.

I may be missing some context, but I would like to point out that additional filters can be added to the Interactive Tables.

Hope this helps, it would be great if you could share your app on https://community.tulip.co/c/show-and-tell/9 :link: once it’s built as it sounds very interesting!!

Gio

1 Like