Hi Vinod,
I tested the same on a collection having both a Text and Number column as well as with a collection having only Number column or Text column. In all these cases it is working. Please find the below screenshot for your reference:
Inputs:
Outputs:
Code:
try
for each dr as datarow in blanks.rows
for each c as datacolumn in blanks.columns
if isdbnull(dr(c.columnname)) Or CStr(dr(c.columnname)) Is String.Empty then
dr(c.columnname) = Value
end if
next
next
no_blanks = blanks
catch e as exception
end try
Parameters:
Cross check once from your end if you are using the same code and parameters along with the type of inputs.
For the second requirement that you have asked, there are few things to keep in mind before I proceed with the solution. There is a concept of default values in VB .NET and C# when you specifically talk about Data Columns which is like if you are generating a table with a column type as "Int32" or "Decimal" or any equivalent numeric class type, it won't allow the data to be filled with Null values and instead will auto populate the table with the default value that in this case would be "0". Similarly, for Boolean class types, the default value would be "False". This is being implemented so as to maintain the integrity of the data types and not have any run time error because of that. Logically as well if you see, blank or null is not an allowed numeric type data so it is should not allowed and that is exactly what is being implemented by auto populating an equivalent of blank which is 0 in terms of number however, from a business point of view "0" always won't signify lack of a data but might be a number having a real life value.
Hence my suggestion would be to treat all you data table columns as Text data type only and use this action in order to get a proper result, otherwise you will find the default values getting auto populated. In the above use case, this would not have been an issue since we were replacing all the blank values but here as soon as you replace some selected fields (blank fields) in a particular column, that moment the other columns would get auto populated with default values which may not be something you would want.
For the second solution add an additional input parameter to the above use case called "
Field Name" and modify the code to:
try
for each dr as datarow in blanks.rows
if CStr(dr(Field_Name)) Is String.Empty then
dr(Field_Name) = Value
end if
next
no_blanks = blanks
catch e as exception
end try
Try this and let me know if it solves your purpose.
------------------------------
----------------------------------
Hope it helps you and if it resolves you query please mark it as the best answer so that others having the same problem can track the answer easily
Regards,
Devneet Mohanty
Intelligent Process Automation Consultant
Blue Prism 7x Certified Professional
Website:
https://devneet.github.io/Email: devneetmohanty07@gmail.com
----------------------------------
------------------------------
---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.