How can we call upper row value based on bottom row value

Hi Team,

I have to call upper row based on the condition that lower row have specific value “Family” if satisfy then upper row should be call.

Please find the below excel and for the same.

Attached .xaml file and below the excel format for the same.

Compliance Information Delivery System Platform1 Delivery System Platform2 Symbol (REF) Symbol (UBD)
Product Family Family Family Family

Creating SCHEMA.xaml (13.0 KB)


You can use For Each Row activity and declare a variable for Index

Use If condition and write as row(“ColumnName”).ToString = “Family”


Assign activity UpperRow = IndexVariable - 1

Hope this may help you


Hi Srini,

Can you please modify my upper .xaml file and share with me .
I tried but its not working at my end.

Suraj Dubey


Currently I can’t do that, but you can debug and see where you are getting error


I tried,

but i just got the syntax error.

Please find the .xaml file for the same.
Creating SCHEMA.xaml (10.6 KB)

Have a check on this and define an index variable e.g. IndexVariable (as you have done in your Code). However we would suggest to give a more meanfully name on it.

getting the row above

Row2 = dtData.Rows(YourIndexVar - 1)
logging - String.Join(“|”, Row2.itemarray)

We would recommend to work with the different debug / inspection options, instead of logging / write line / message dialog. Have a look here for this:
Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum

Its not working.

this feedback will not tell us, what was done, what is not working.

Looking to your case and XAML there are also some doubts on what is done and what is tried to get achieved.

So, we would recommend, that you just go one step back and have a view on the Requirement / Business Process independend of the implementation.

When we read in an Excel we control with the AddHeader flag if the first row is to use as data column header names or not. In case our data starts some more rows below, we just modify the offset (e.g. A4, to ommit the the first 3 rows).

What is different in your case / Excel and will not fit into the defaults described above?


In our condition header is not available.

Based on row2 condition we have to call row1 value.


maybe you can share excel.

A more direct approach would be

find row index by
Assign Activity
idx | int32 =

YourDataTableVar.AsEnumerable.ToList.FindIndex(Function (x) x(ColNameOrIndex).toString.Trim.Equals("Family"))

Assign Actvity
rowAbove | DataRow =
YourDataTableVar.Rows(idx - 1)

CreatingFamilySCHEMA.xaml (12.7 KB)

Below is the format of my excel (A to E rows).

Compliance Information Delivery System Platform1 Delivery System Platform2 Symbol (REF) Symbol (UBD)
Product Family Family Family Family