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

For each row in Excel in JavaScript

Hi all,

 

I am new to trying to use JavaScript in Desktop. I already read an excel file and have it in a 'datatable'. How do get a 'for each' in Javascript and execute an action for each row in the datatable, all in JavaScript?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
VJR
Super User
Super User

Hi @Dion_tw 

Not sure why exactly are you trying to do that when you can use the PAD's "For each" action to loop on the datatable. Maybe performance for thousands of rows?

I do not think if we can use the PAD's datatable variable and loop it within a javascript.

But since you are already using Excel, you can also use javascript to loop within the Excel rows directly.

 

Here is a direct link to the post where I have shared the javascript code.

 

 

View solution in original post

2 REPLIES 2
VJR
Super User
Super User

Hi @Dion_tw 

Not sure why exactly are you trying to do that when you can use the PAD's "For each" action to loop on the datatable. Maybe performance for thousands of rows?

I do not think if we can use the PAD's datatable variable and loop it within a javascript.

But since you are already using Excel, you can also use javascript to loop within the Excel rows directly.

 

Here is a direct link to the post where I have shared the javascript code.

 

 

Thanks! that helps a lot. Yes, its because of performance, JavaScript is always faster. Also because i can go from 20 to 1 action now:)

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,622)