Select one column from excel with variable

Hello,

I would like to present you with, a ready-to-use solution for small bunches of data taken from Excel Workbooks via Power Automate Cloud, where you would like to limit taken columns to one of them, without knowing the full column name. Of course, to make everything harder, Excel Workbook’s table is also given as a variable, so we can post everything in the middle of a more advanced flow, such as a huge ‘apply to each’.

But, for the beginning, let’s describe more clearer our objectives for this thread:

  1. Ready to re-create as a scope in bigger flow, smaller flow.
  2. Listing rows from a table in Excel, which name’s is stored as a variable.
  3. We would like to limit our output to single column array;
  4. We don’t know full name of column, so we want to use contains expression.
  5. As an output, we would like to have an array from this one column, for further operations.

Now, we can go with our flow creation:

Simple instant flow type, taken for my requirements:

Then, list rows from your table that name you can provide in variable

split(string(first(outputs('List_rows_present_in_a_table')?['body/value'])),'",')
split(replace(replace(replace(item(), '"', ''), '}', ''), '{', ''), ':')[0]
body('Select')
item() contains string('your variable')
item()
outputs('List_rows_present_in_a_table')?['body/value']
{
    "value": @{item()?[outputs('Compose')]}
}

Feel free to correct me in the comments section, I will update this flow description accordingly if required to have ready to use solution.



Leave a comment

About Me

As a power platform fan and developer of solutions that can help in daily tasks, I have a deep understanding of how technology can be leveraged to make everyday work more efficient and effective. With a passion for automation and optimization, I am always looking for new ways to streamline processes and save time. I have a strong knowledge of the power platform, including Power Apps, Power BI, and Power Automate, and I am skilled in creating custom solutions to solve specific business needs. My expertise and enthusiasm for the power platform make me an invaluable asset to any organization looking to enhance their productivity and streamline their workflows.

Newsletter

Design a site like this with WordPress.com
Get started