Get Header from Row Value

Hi Everyone, kindly seek your input, i have use case to get the Header Value from each row like image below:

Any input how to achieve it in Studio? thank you

Hi there,

Please explain the use case in detail and use examples.

hi, i’m sorry for not give the detail

the use case sample:
start from row 3, i will check in which header (Program 1, Program 2, Program 3) that has any data under it.
example:

  1. in row 3, the output will be Program 1
  2. in row 4, the output will be Program 2
  3. in row 5, the output will be Program 1
  4. in row 6, the output will be Program 3

understood, thanks.

I would be able to have much more robust solution suggestion but not knowing the end goal, I will provide something based on the minimal info you gave me.

Use a read range to read the excel data into datatable: OutDT

image

Use a For Each Row in Data Table activity to iterate through the datatable:

image

Use an Else If activity to perform the checks on each datarow item, with these conditions:

  1. Check if datarow contains ‘Program’ Or contains ‘Name’, then skip to the next:
    CurrentRow.ItemArray.Contains("Name") Or CurrentRow.ItemArray.Contains("Program")
    image

  2. Check if CurrentRow(0) is not empty then its Program1
    Not String.IsNullOrWhiteSpace(CurrentRow(0).ToString)
    image

  3. Check if CurrentRow(3) is not empty then its Program2
    Not String.IsNullOrWhiteSpace(CurrentRow(3).ToString)
    image

  4. Check if CurrentRow(7) is not empty then its Program3
    Not String.IsNullOrWhiteSpace(CurrentRow(7).ToString)
    image

Here attached:
Practice01.zip (10.5 KB)

If it’s always Program 1 (3 columns) then Program 2 (4 columns) then Program 3 (3 columns) then just use three separate Read Ranges and designate those ranges ie A:C D:G and H:J.