@Aishwarya_Bhargava According to the requirement, If you are working on Datatables manipulation and updating the Excel Sheet, then one way would be to Concatenate the DDD+EEE Column Values first and place it in the DDD Column itself. So that You wouldn’t have to worry about the EEE Column and you can delete it with Remove Data Column Activity.
Hence, you would have 4 Column Names to be replaced with 4 new Column Names.
Next, You can just use an Assign Activity to Update the Old Column Name to New Column Name in the Below way.
DT.Columns("AAA").ColumnName = "ABC"
Where DT is the Datatable variable name.
Similarly you can update the Other Column names as well.
However there are other methods to update the Column Names, and let us know your review on this method whether this method is suitable.
If this method is not helpful please let us know more about the requirement in detail.
how can i concatenate the 2 columns
the thing is
if DDD is empty or EEE is empty no concatenation i just need to write that cell exactly but if both are present then concatenation
@Aishwarya_Bhargava This can be done using an If Condition.
So if you want the Columns to be concatenated when only both the Column Values are present, then below Interpretation of the code should be helpful in achieving the required logic.
For Each Row in DT
If Not(String.IsNullOrWhiteSpace(row("DDD").ToString) or String.IsNullOrWhiteSpace(row("EEE").ToString))
Then
row("DDD") = row("DDD").ToString+row("EEE").ToString
Else
//Empty, No Code
There may be differences in the requirement as to what is put and understood.
Let us know if you’re still facing a problem, and please provide more details about the problem faced
@Aishwarya_Bhargava Can you Check the below Workflow :
It uses a Invoke Code Activity where it Updates the Datatable using the For Each.
I have manipulated the Condition to only update the rows having both the DDD and EEE column Values.
Let us know if it works and if it is able to optimise the process better. Update_InvokeCode_Demo_SetField.xaml (5.9 KB)
it is good when both the columns are filled but what if one of the columns are empty in that it is still concatenating
which should not happen in that case it should just copy the filled cell
@Aishwarya_Bhargava Comparing your Expected output and the Statement that you have mentioned before, we needed to not Concatenate when Either one of the Columns are Empty, But the Expected output has Concatenated value (Value From EEE Column in 2nd Row is Moved to JKL, even though DDD Column was Empty).
If you need the Expected output in the same way then you wouldn’t need to add any condition to your flow . You could directly update it for all the rows.