web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Write Variable in dyna...
Power Automate
Answered

Write Variable in dynamic column

(0) ShareShare
ReportReport
Posted on by

Hi community,

 

I want to write the variables "First name" and "Last name" into an Excel file. I want Power Automate Desktop to find out for itself in which column the "First name" should be written, depending on the column header in the target file. So that the column is dynamic and the variable is written in, for example, column 1 or whatever.

Has anyone experience in a similar case ? Or even a solution?

example screenshotexample screenshotexcelexcel

I have the same question (0)
  • Verified answer
    fraenK Profile Picture
    2,125 on at

    To make it "dynamic", you'll need to read the Excel file first to get the headers and their column numbers.

    "Write to Excel worksheet" only works with column number or letter.

    Cloud flows handles Excel files much better.

  • Community Power Platform Member Profile Picture
    on at

    It is suprisingly complicated to do this in PAD. Write to %Row[%N%]% is not allowed and hence a workaround is required. 

     

    Here my end goal is to write '' into the Column with the header of Done? into any row where the value contains "ERROR"

     

    The solution in short creates a variable %N% which is the Column Number that contains the header of "Done?". 

     

    The workaround I found that works is shown below1.png2.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard