Automate selection values only according to values entered in another field

My Setup:

  • SeaTable Cloud

Description of the question:

Hello,

I’m experiencing a problem for which I haven’t been able to find an ideal solution.
I hope you’ll excuse the tinkering I’ve done in trying…

As part of a UniversalApp, I’ve created a small form in which I ask my colleagues to come and give me some data (suggestions for QWL improvements).
However, if this data already exists, I want them to be able to select it.
The problem was therefore to set up a system to collect the values entered by the first users and offer them to subsequent users in “selection” mode.

1st problem: I haven’t managed to create a system that feeds a single-selection column => is this possible?

To overcome this, I created an automaton duplicating the value of text fields in a second table, which I then offered in the main table as a “link to other records”.
This works in part: users in the form can select the available values, but it brings me to my 2 other problems:

2nd problem: the record link table doesn’t seem to be customizable at all. The title reads “Link records” and the field values are heavily cropped => do you have a solution?

3rd and last problem: the proposed values are duplicated and proposed in duplicate, triple, etc. to my users if I use this method => how can I automatically hide the duplicates?

Many thanks for your help!

How about to to several pages to make the process simpler.

Say, you have two tables, one is primary table, another is linked table.

For example, you can have a page (like query page) to let users check the existence of a data in the linked table, if not, let them enter the data using another table page.

Then let users to enter data into your primary table using a table page.

Hello,
Thank you for your reply.
It’s an alternative I’ve considered, but our users won’t look before entering their data. They’ll certainly be lazy…

Hi @clement.b, and welcome to the SeaTable forum!

Here is my idea for your problem:

  • One single table (I called it 'Suggestions in the script bellow, you’ll have to change this to match your exact use case), containing at least three columns:
    • a single select column, let’s call it “Existing suggestions” (once again you’ll have to modify the columns’ names in the script bellow)
    • a checkbox column “Can’t find my idea”
    • a text column “New suggestion”
  • In the form you created, you activate a conditional displaying rule for both “Existing suggestions” (shown only if “Can’t find my idea” is unchecked) and “New suggestion” (shown only if “Can’t find my idea” is checked). Displaying the “Existing suggestions” as a dropdown or as a list is up to you, but as far as I tested they are both able to display very long options (at list on a computer screen, I didn’t test on tablet or smartphone)
  • then, you add the following Python script and create an automation to run the script for every row added with the filter condition of “Can’t find my idea” being checked
from seatable_api import Base, context
base = Base(context.api_token, context.server_url)
base.auth()
col = base.get_column_by_name('Suggestions', 'Existing suggestions')
row = context.current_row
found = False
print(col)
if 'data' in col and col['data'] is not None and 'options' in col['data'] :
  for option in col['data']['options'] :
    if option['name'] == row['New suggestion'] :
      found = True
      break
if not found :
  base.add_column_options('Suggestions', 'Existing suggestions', [
    {"name": row['New suggestion'], "color": "#aaa", "textColor": "#000000"}
])
# optional part below to delete the already existing solutions: 
#you can activate it or not, depending on your need to track suggestions for each user
# if you want to activate it, just delete the ''' above and below the following else command
'''
else :
  base.delete_row('Suggestions', row['_id'])
'''

I hope this could help you. Doing so, the users will have to scroll the list of existing suggestions before being able to make a new proposal. However, the comparison between a new suggestion and the already existing options of the single select is base on a string, so comparison can fail for stupid reasons like one more space, an uppercase letter, etc. The comparison test ( if option['name'] == row['New suggestion'] ) could probably be improved to better deal with these pitfalls…

Bests,
Benjamin

Your problem solved?