Add data into specific data table cell

How can we enter the Text that we receive into a Data Table Value Column?

Also how can arguments be stored in data table values?

Example There is a data table in Below format

  1. The Variant and Company Name are already specified just the data table should get updated with the value depending on Variant and Company Name

Variant|Company Name|Value

Hi @anmita ,

For these kind of update operations we basically go for For Each Row in Datatable and then Update the values using Assgin Activity after the Conditions match using If Activity.

Have you tried this approach ? Or if this is not what you were looking for, Could you let us know what exactly is your Requirement ?

We have the following Info from your End :

  1. Datatable/Excel filled with Variant and Company Name.
  2. Inputs would be Variant,Company Name and Value.
  3. Based on the Inputs Update it’s corresponding row’s Value column.

But we need to know whether there would be multiple values that need to be updated or just a Single value/row in Datatable.

Hi @supermanPunch
If I will use If then I might have to create multiple scenarios I can try that .But are there any other way

1)Yes the data table we can fill with the Variant and Company Name before hand leaving the Value column blank
2)Based on Variant and Company name corresponding Value field should be filled

Different Variant and Company will have different Value

Example
XXX| ABC|1000
YYY|###|2000

@anmita ,

Then Could you let us know How these Input values are stored for Comparison with the table that should be updated with Value ? Are these values stored in Another Datatable/Excel ? How are these values retrieved ?

@supermanPunch ,
They are retrieved in form of Queue Items and then the Values are generated and Stored in form of Argument

@anmita ,

Is an RE-Framework or Get Transaction Item Activity being used ? Then for each received Transaction do you want to update the value in Datatable ? Or Are all the Queue Items collected at once using Get Queue Items Activity ?

Depending on the approach being used we could decide on the method to be used for Update.

@supermanPunch ,
It is using get queue items Activity

@anmita ,

Maybe you could try with the below Approach at first which uses For Each Row in Datatable Activity.

We also use a Linq to filter the matching items from the Queue Items retrieved. Then if there are matching values, we retrieve the Value from that matching item.

MatchedItems = queueItems.Where(Function(x)x.SpecificContent("Variant").ToString.Equals(row("Variant").ToString) AndAlso x.SpecificContent("Company Name").ToString.Equals(row("Company Name").ToString)).ToArray

Here, MatchedItems is a variable of type Array of QueueItem and queueItems is the Output of Get Queue Items Activity.

The Assign Expression inside the if is as follows :

row("Value") = MatchedItems.First.SpecificContent("Value").ToString

Let us know if you are not able to follow the above approach.

Thanks @supermanPunch for your quick response will definitely try this approach :slight_smile:

1 Like