cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MKH
Regular Visitor

Generate PDF from Excel - Apply to Each Error

Hi Folks, hope your all having an awesome day unlike me !  ☹️

 

MS Flow Question:

 

I’m working on an automation project to populate about 500 pdf letters from excel worksheet using MS Flow.

 

The flow I created is working for one pdf file (with get row instead of list rows and without apply to each), but once I add List Rows and the apply to each control command to repeat the process for multiple pdfs I get this error, see below.

Flow Error.jpg

 

Here is my flow:

 

Part 2Part 2Part 1Part 1

 

I'm hoping someone would point me in the right direction.

 

Your help is much appreciated !

1 ACCEPTED SOLUTION

Accepted Solutions
abm
Super User
Super User

Hi @MKH 

 

Thanks for the screen share. So the issue was Create File steps are outside the loop. Earlier it was overwriting each document with same file name. So to fix the issue we did dynamically map the filename using one of the properties and moved all the steps inside the foreach loop.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

View solution in original post

6 REPLIES 6
abm
Super User
Super User

Hi @MKH 

 

The error says you are trying to map Claimants Dynamic property is type of array. That means it could hold more than one values. If you directly mapping against your document template you will get the error. To resolve this you need to use Parse JSON to iterate the relevant value and map in your template. The reason for the first one is working is it may be returning no values. Check your run history and see what it returns for the first run and subsequent. 

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
MKH
Regular Visitor

@abm How can i do that ? i'm not familiar with Parse JSON. I looked it up online, i couldn't find anything related to excel and  Parse JSON.

abm
Super User
Super User

Hi

 

Could you please post a sample data of that column?

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
MKH
Regular Visitor

Sure, here you go:

 

First Column

CHOICE ELECTRIC INC
TRUE WORLD FOODS LOS ANGELES
FARCHITECTURE BB, LLC
NASSAU-SOSNICK DISTRIBUTION
BUTY & CURLIANO, LLP
FOLSOM LAKE APPLIANCE INC.
EXPRESS FREIGHT SYSTEM
BRIAN MCDONOUGH, INC.
METRO MAILING SERVICE, INC.
BOSCH BAKING INC.              
DOMEL INC
SAN DIEGO CASH REGISTER, INC.
TPS PLUMBING SUPPLY INC

 

Second Column

5/24/2015
5/14/2016
6/11/2016
7/13/2016
8/1/2017
8/14/2017
8/30/2017
9/8/2017
9/13/2017
9/11/2017
9/25/2017

So essentially what I'm trying to do is to get each cell content from those fields to populate into word doc fields then convert it to a PDF. I'm doing this for multiple columns from the excel sheet to multiple fields in each word doc but if i figure how to do it for two columns and repeat it, i think i can do the rest. 

abm
Super User
Super User

Hi @MKH 

 

Thanks for the screen share. So the issue was Create File steps are outside the loop. Earlier it was overwriting each document with same file name. So to fix the issue we did dynamically map the filename using one of the properties and moved all the steps inside the foreach loop.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

View solution in original post

MKH
Regular Visitor

@abm walked me through the process and fixed the logic flaw i had with my flow.

 

@abm Thank you so much for your help ! @abm  Highly knowledgeable and well recommended to be used as a resource for flow questions. 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,106)