Collection - Dynamic header names

Malligai

Member
Hi all,

Am extracting data from excel to collection, for eg(only 4 columns). The first header is dynamically changing, others remains same .
For eg : My collection is having the headers like(sample 10 2018, customer, client, code). In this i have to extract the code (in D column), based on the value in "A column".

Issue : sample 10 2018, this 10 will change dynamically.

Expecting solution : If the "sample 10 2018" value is = code A, then i need relevant Column D (code).
NOTE : Please check the attachment for the detailed view (i have added as initial value, but when we are getting through collection from excel, it will be there in current value)

It would be very grateful, if someone could assist on this.
 

Attachments

  • RPA forum.PNG
    5.7 KB · Views: 39
  • current value.PNG
    3.7 KB · Views: 36
Could you please give clarity on your doubt.... I am not bale to understand whether you want to get data from excel or collection.
 

VJR

Well-Known Member
Hi Malligai,

I read and re-read the post multiple times but I am not clear about it.
Also it is confusing that the title is referring about the headers but the details in the 2nd screenshot appear to be about the changing values.
 

Malligai

Member
Hi VJR,

The requirement is we have to get the values based on headers in collection. example am getting column A ( Column name is : "sample 10 2018" from excel) but the next day the same column will appear in Column D or B or C, it will change dynamically.

So i have to extract the appropriate values based on headers, eventhough it is changing into "Sample 11 2018 (or) sample 12 2018).

Is there any way to get this value...

Thanks,
 

VJR

Well-Known Member
The header "sample 10 2018" can be in any of the columns and the number 10 can be changed to anything. Is the understanding correct?

If so you can achieve what you are looking for by doing the below-

- Use the 'Get Collection Fields' action.
- This will return a collection of all the column names
- Then loop through that collection. Inside the loop check if the column name contains "sample" using the Instr function.
Take some reference from Post #2 here, although it is for a different purpose but you can refer getting the column names and then looping.
- Once the match is found, grab that complete column name (eg; sample 10 2018) and then use it to check the value of that column.
 
Top