cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dashort
Helper I
Helper I

Desktop - Extract specific row and column values from Excel

Hi, I am able to create the table and extract it to a variable - ExcelData.

I want to go through a specific row and extract each column to enter it on a website.  

I do not see how to specify the row value in the statements and I'm not trying to run a loop as each row will be entered at different times.

 

Is there someone that knows the syntax to specify what I would think would look like  %ExcelData(Row)(Column) ?

 

Thanks in advance.  This is a really great community!

2 ACCEPTED SOLUTIONS

Accepted Solutions
yasunm02
Solution Sage
Solution Sage

Sorry @dashort, gave the first answer without really testing it. My bad.

I think I was able to replicate your error scenario with this flow:

1) Launch Excel

2) 'Read from Excel worksheet' to get an ExcelData variable 

3) 'Display input dialog' to input row number as test (%Row% as output)

4) 'Set variable', to see result of %ExcelData[Row][1]% in Flow Variables panel

Got the same error message you mentioned: "Variable "ExcelData" doesn't have a property "x"".

Problem is, using input dialog in this case resulted in %Row% variable as text type.

So I added a 'Convert text to number' action to convert %Row% into a new variable called %RowNumber%, prior to throw it at an adjusted %ExcelData[RowNumber][1]%.

Worked as desired. Check if it applies to your case and give it a try.

View solution in original post

11 REPLIES 11
yasunm02
Solution Sage
Solution Sage

dashort
Helper I
Helper I

Thank you for being patient with a noob and taking the time to show me the answer!

dashort
Helper I
Helper I

 If you want a curveball, tell me how to enter a variable for the row number 🙂  I've tried %ExcelData[VariableName][2]% but it didn't like the variable and told me that it didn't have a property "4", which was the value for the variable, and the row which I wanted.

yasunm02
Solution Sage
Solution Sage

Hi @dashort 

Not sure if that's what you asked, but you can define the variable value by 'Set variable' action under 'Variables' group.
In your case, you have to previously add a 'Set variable' to define %VariableName% with the value you want.

Also, notice that Power Automate Desktop is zero base. So, to get the value of first row and first column in your ExcelData variable, you have to use %ExcelData[0][0]%.

I was looking for a way to use a variable to specify the row so that I can be more flexible and not tied down to a single entry. I tried %ExcelData[%RowVariable%][2] and it spit out an error. 

yasunm02
Solution Sage
Solution Sage

Correct syntax is %ExcelData[RowVariable][2]% in this case.

dashort
Helper I
Helper I

Thanks again for your time. When I put the variable in for the row number, I get told "Variable "ExcelData" doesn't have a property "2".  2 is the value for the variable, so at least it's reading it.  I'm not sure how to tell it that I need that particular row number....

Sorry @dashort, gave the first answer without really testing it. My bad.

I think I was able to replicate your error scenario with this flow:

1) Launch Excel

2) 'Read from Excel worksheet' to get an ExcelData variable 

3) 'Display input dialog' to input row number as test (%Row% as output)

4) 'Set variable', to see result of %ExcelData[Row][1]% in Flow Variables panel

Got the same error message you mentioned: "Variable "ExcelData" doesn't have a property "x"".

Problem is, using input dialog in this case resulted in %Row% variable as text type.

So I added a 'Convert text to number' action to convert %Row% into a new variable called %RowNumber%, prior to throw it at an adjusted %ExcelData[RowNumber][1]%.

Worked as desired. Check if it applies to your case and give it a try.

Ahammad_Riyaz
Super User
Super User

Hi @dashort 

 

Please check on this

 

%ExcelData[Row][Column]%

Brilliant!  Thank you for getting this sorted.  I appreciate your persistence!

MarioOne
Helper I
Helper I

Hey All, I found this topic relevant to the use case I am investigating here on this community.

Can you suggest how to structure the query in this flow?

MarioOne_2-1634244000808.png

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Top Kudoed Authors
Users online (3,179)