1

I would like to extract only specific column data from the table. For example, in the following table I want only 'WK1' data when the loop is run

Email       | WK1 | WK2 | WK3
[email protected] | 0   | 0   | 0
[email protected] | 1   | 0   | 0

Any leads on how to fetch based on the column name? the column name is not fixed and on each run it may change based on other fields.

Flow

2 Answers 2

3

I am assuming that the you need to capture the all rows data in an Array variable for a particular column (Wk1, WK2 etc.) dynamically.
Your dynamic column name has to come from somewhere. Let's assume that you are able to get your column name. Follow the step below to do what you want to achieve.

Step 1 - Initialise a variable ColumnName and assign you column name dynamically.
Step 2 - Initialise a variable DataSource of type Array
Step 3 - Insert a step Append to array variable inside For loop.
Step 4 - Use below mentioned formula to get the value from item() property for your dynamic column name. You can simply put it in expression field.

string(item()?[variables('ColumnName')])

enter image description here

Sign up to request clarification or add additional context in comments.

3 Comments

This is actually pretty useful for my situation. Upvoted. Thanks.
Thanks for the tip. I didn't use Append to array variable, but i used Select and could filter the required column.
@Dinesh I used that action to showcase the method. Formula was the essential part. You are free to use whichever action suits your use case.
0

Since you asked for "any leads" this below example will pull various intersections from a table. It is indeed pulling specific columns based on their names (not position). What's likely tripping you up is that to get column data, you have to get a row first.

In the below example, I have an excel call that gets a specific row within the table (by matching the column Guid with a value that matches a Form Submission). From that point, you can see my email template that inserts a bunch of green fields that are actually the column names from my table for the specific row I specified.

Example of pulling table information and putting in flow.

Here's a view of the table it might be pulling from.

enter image description here

2 Comments

In my case, the Guid itself is a variable. column i want to fetch is not fixed. So is there any way to give variable in that place?
I feel like since you have an SO score of over 500 you probably already know this, but sure there's a way. You need to create some dynamic technical definition or set of instructions. I don't know how else you'd expect it to work (read your mind?).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.