Bulk upload type enumlist

Dear Community:

We are having problems with the bulk upload for the enumlist type field.

We are not being able to perform the bulk upload.

We have seen the following article but have not found the solution.

Yesenia_Leon_0-1730998668884.png

We would appreciate your help

0 13 390
13 REPLIES 13

We need some more details of what "bulk upload" means to you. 

Dear @WillowMobileSys :

CSV Upload EnumList ValidIf Error.

 

Is your case something similar to the following case?

CSV Upload EnumList ValidIf Error - Google Cloud Community

It sounds there is no confirmed fix yet at AppSheet level itself.

@Yesenia_Leon @Steve @Suvrutt_Gurjar 

Isn't the issue here that data in the column, for List's in general, must be separated with "SPACE COMMA SPACE"?

Here's a comparison.  2 EnumList columns implemented in exactly the same way.  Test List 1 column initializes with USUAL comma separator.  Test List 2 uses the "SPACE COMMA SPACE"

Screenshot 2024-11-08 at 9.49.48 AM.png

What this means for the CSV file, is that the list columns either need to be initially written to the file with the "SPACE COMMA SPACE"...OR...there needs to be a conversion performed after the file is created or after it is uploaded.

I haven't done much with CSV importing so I can't speak from experience--it's possible CSV import has different rules. Elsewhere in AppSheet, though, space-comma-space should be used as the separator.


@Steve wrote:

I haven't done much with CSV importing so I can't speak from experience


Same here.   It just occurred to me...How are Lists represented in a CSV file for import into AppSheet?

Can values in a CSV be quote encapsulated?  It's been a while since I worked with CSV files.

Steve
Platinum 5
Platinum 5

Please post screenshots of the screen showing the error message, the configuration of the affected EnumList column, and of that column's Valid if expression.

@Yesenia_Leon 

Could you please try a valid if expression as follows in that enumlist column [Grupos] and then perform CSV upload?

IFS(CONTEXT("Host")<>"Server", SORT(SELECT(Grupos[Grupo], [Estado]="Activo")))

If the above works, we could discuss the merits / demerits of this revised valid_if expression. 


@WillowMobileSys wrote:


Isn't the issue here that data in the column, for List's in general, must be separated with "SPACE COMMA SPACE"?


That is a very good point @WillowMobileSys . You are correct that the space_comma-space should be respected in CSV being uploaded.

However in CSV upload having enumlist column values, I believe there could be additional issues of valid_if validation happening at sever level as described by @Phil  in an earlier post thread referred above.

 


@Suvrutt_Gurjar wrote:

However in CSV upload having enumlist column values, I believe there could be additional issues of valid_if validation happening at sever level as described by @Phil  in an earlier post thread referred above.


Understood.  It appears to me from the video and the other post, that the Import process is treating the EnumList column value as a TEXT string and not a list of values.  (I am still curious how AppSheet knows it's a list of values for a single column)

I think maybe the validation needs to be handled with the INTERSECT() function.  Something like:

COUNT(
INTERSECT(
SPLIT([_THIS], ","),
SELECT(Grupos[Grupo], ...)
)
) > 0

This expression may need tweaking BUT should work regardless if the values are treated as a LIST or a TEXT string - i.e. on the client or on the server-side.

When I get some time later today, I'll test this out - unless one of you have beaten me to it!!!

@Yesenia_Leon @Suvrutt_Gurjar @Steve 

I played with this more and here is what I have done to resolve.

First, trying to use a List for validation doesn't allow the CSV import at all.  The reason is that the imported list of values is treated as a Text string and using a List for validation requires ALL logical results to also be lists.  I could not come up with a validation list that would also allow an arbitrary imported list from the CSV.

So, to make this work, I needed to use logical Yes/No validations with an Error message and move the selection list to the Suggested values Property.  With these modifications, I was able to import the CSV file. 

Here are the things I did.  You will need to replace the SELECT() with your own from above.

Valid If Expression:

COUNT(
INTERSECT(
SPLIT([_THIS], ","),
SELECT(Test Values[Value], [Active] = TRUE)
)
) = COUNT(SPLIT([_THIS], ","))

Invalid Value Error message I used:

"Invalid values. Please correct selections. Possible values are " & SELECT(Test Values[Value], [Active] = TRUE)

Suggested Values Expression:

SELECT(Test Values[Value], [Active] = TRUE)

Location of the above expression in the column configuration
Screenshot 2024-11-10 at 6.44.14 PM.png

Example of the validation on the Form View
Screenshot 2024-11-10 at 6.43.41 PM.png

NOTE:  If you decide you want to allow anything in the CSV to be imported, valid or not, then you simply need to adjust the validation logic

I hope this helps!

 

Thank you @WillowMobileSys for all the testing and further investigation.


@WillowMobileSys wrote:


So, to make this work, I needed to use logical Yes/No validations with an Error message and move the selection list to the Suggested values Property.  With these modifications, I was able to import the CSV file. 


The above , especially the highlighted part seems to be crux of the workaround solution to overcome the valid_if issue.

I will also mention in this thread just in case , I also come up with any more findings , workarounds.

 

Top Labels in this Space