Show duplicated values in an Enumlist

data
(GM) #1

Hi there,
Is there a possibility to force Enumlist to show values “non-uniquely” so to say? Imagine the following list: Apple, Apple, Apple, Orange, Lemon, Cherry, Cherry.

I’ve created a Valid_if condition from a list with duplicate values in google sheets but appsheet automatically return just unique values. (so following the example: Apple, Orange, Lemon, Cherry)

I want the full list (duplicates included) to be shown in the Enumlist to allow the same values to be selected multiple times.

Is there a way to do it?

#3

Hi, @GM_Apps up to how many duplicates do you need. What is your use case/ There may be another way to obtain your required result.

(Levent Kulacoglu) #4

@GM_Apps
I’m afraid you can’t have duplicate values in an ENUMLIST or an ENUM field, because there is no definitive break point between duplicate values in a way that they will be treated as unique list items.

(GM) #5

That’s a pity :frowning: thanks fot the answer @LeventK

(GM) #6

Thanks @Lynn, imagine something like this, there are a bunch of options and I want an easy way to pick several of those options potentially even multiple times. Both these two goals should be easy to achieve without moving 200 times between different views.

The result, at least the logic, should be something like the screenshot I’m attaching.
24

The Enumlist solution that I asked help for was an attempt to achieve this yet not in a very elegant way.

#7

Hi @GM_Apps Have you had a look at the Order Capture and Inventory sample apps? There is a link to the sample apps at the top of this page.

(GM) #8

Hi @Lynn I did but they do a differnt thing, they mange signle products/order individually. I need the result to be printed in the same cell since the I’m using Apps Script to manipulate the data.

So, using the data from the screenshot the output in the google sheet cell should be Avocado,Avocado,Avocado,Goma wakame. That’s what i’m trying to do/achieve

(Levent Kulacoglu) #9

@GM_Apps
Is there a specific reason that you want to show them as separate list items rather than one? I mean instead of
{“Avocado” , “Avocado” , “Avocado” , “Goma wakame”} just having {“Avocado” , “Goma wakame”}

(GM) #10

Hi @LeventK, yes there is, I manipulate those data with google apps script, splitting the values and counting the occurrences to do other stuff with it. I need it to be this way

(Levent Kulacoglu) #11

@GM_Apps
I got your point but as there are no descriptive way to differentiate those list items, you cannot have them repeating in an ENUMLIST or an ENUM field unfortunately. If you can have them listed as:

{“Avocado-1” , “Avocado-2” , “Avocado-3” , “Goma wakame”}

you can still split the list and count them with the GAS using str.indexOf("Avocado") for example.

(GM) #12

Thanks @LeventK that’s a good point, i’ll give it a try :wink: