Default datetime assignment in restricted database populating using Bulk Insert

We needed to use a bulk insert activity to a database for data loading
The database has some conditions to load data:
• The database consists of 8 columns and we only need to process data for 5 columns.
o x column datetime format and filled by us
o y column string format and filled by us
o z column string format and filled by us
o u column string format and filled by us
o v column decimal format and filled by us

• 3 columns that we do not enter data are filled by default.
o ID column Int64 format and default fill
o t column datetime format and default fill
o w column string format and default fill
These columns are left blank.

We created a built data table to use bulk insert activity. We filled the data requested from us into the datatable.(Img_1)

                                 Img _1 (red-framed data will be filled by default. These columns are left blank.)      

We used bulk insert activity to insert the generated data(Img_2)

We got this error while running.(Img_3)
image
Img_2

					Img_3

We assigned the value for the column in the error message on the built data table and we encountered a red-framed warning.

					Img_4

Same error message repeated.
If anyone encountered this problem as well here is the workaround;

The add data row activity can be used for data that cannot be assigned on the built data table activity. (Img_5)

In this way, the “datetime.now” value that we want to enter into the data table is processed without any problems.

image

		Img_5

Add Data Row Activities-ArrayRow Input:

1 Like

How is the table defined in DB? What is the type for that column? Most likely it’s a double and not a date.

You can look at the built data table columns. The fields entered by the user are specified. If you want to see the error as soon as possible, create a built data table and make a field type datetime. Try to insert the “Datetime.Now” data. If you fail then add same value as Add Datarow(Array Row)

1 Like

Hey @Ekrem_BAYRAM

Just to clarify - when you assigned a value by using the Add Data Row activity, it worked well with the Bulk Insert afterwards?

It looks like the Build Data Table activity doesn’t support expressions and seems to ignore any input that didn’t match the desired data type (resulting in a null on the cells with an issue). This can be easily verified because the activity doesn’t even save those red framed fields.

It looks like you have already found the workaround though, which seems to be the way to go here.

I’ll still ping @alexandru whether this will be improved in the future :slight_smile:

thanks for you’r support. (bulk didn’t work)

Maciej Kuzmicz via UiPath Community Forum <uipath@discoursemail.com>, 4 May 2022 Çar, 11:30 tarihinde şunu yazdı:

Could you clarify? From the topic above, it looks like this flow works:
image

And the issue is purely with the Build Data Table not supporting the expressions. Does that sound correct?