Expand my Community achievements bar.

Announcing the launch of new sub-community for Campaign Web UI to cater specifically to the needs of Campaign Web UI users!
SOLVED

Import data via CSV into custom table

Avatar

Level 1

Hi All,

 

I have a use case where I am importing some data into custom table and in that table I am creating a attribute name as CompanyType as string enum using userEnum="" .I have fixed values to be entered into this column lets say A,B and C

 

Now I want when user upload a csv file and when map column with this enum column all rows where it's not matching with pre fixed enums value in our database should get rejected. 

 

So if in csv file I have one row where companyType is D it should get rejected and also if this have small a then also it should get rejected. Only allowed values are A,B and C. 

Can someone please help me out how to resolve this ? As i have created userEnum as closed type still it's not working and user able to enter any values via CSV into this table. 

 

Thanks

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi @AC_Dev 

You can achieve the fixed list at the Load Activity level.

Edit the format 

Denis_Bozonnet_0-1657699308924.png

 

Select the field you want to format and click on the Detail magnifying icon

Denis_Bozonnet_1-1657699374094.png

 

In the Details, use the Remapping section to fill in the expected values from the value in the file to the expected value in the data schema

You would have to set error to use a default value in case of error

Denis_Bozonnet_3-1657699541522.png

 

Hope this helps,

Thanks

Denis

View solution in original post

3 Replies

Avatar

Community Advisor

Hello @AC_Dev 

You can add a split before your update data activity and only accept where the value is A.B and C.

 

Or 

 

You can add a condition in the "Taken into account if" section of the update data activity to only update records when A,B or C is coming in the data.


     Manoj
     Find me on LinkedIn

Avatar

Level 1

Thanks Manoj for the alternatives but that include extra check at workflow level , since we are creating Enums as closed Type so expectation was even if we try to insert value to this field system should restrict it and give some errors. 

Avatar

Correct answer by
Employee Advisor

Hi @AC_Dev 

You can achieve the fixed list at the Load Activity level.

Edit the format 

Denis_Bozonnet_0-1657699308924.png

 

Select the field you want to format and click on the Detail magnifying icon

Denis_Bozonnet_1-1657699374094.png

 

In the Details, use the Remapping section to fill in the expected values from the value in the file to the expected value in the data schema

You would have to set error to use a default value in case of error

Denis_Bozonnet_3-1657699541522.png

 

Hope this helps,

Thanks

Denis