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

Using Flows In Powerapps

Hello I'm building an app and I encounter a strange issue with my flow that I can't solve.

I had created a flow to print a pdf and it worked on my first app. when i copied the flow to use it on the second one the pdf came out blank. The HTML file is ok on both but not the pdf.

The onli difference between the original flow and the copied one are the destination folder and the referencec inside the html as below. 

Attached are pictures of the two flows

and here the instructions

Instruction on the onselect function for the working flow

'PowerApp->Createfile,Convertfile,Createfile2'.Run("<!DOCTYPE html>
<html>
   <head>
      <title>HTML Table</title>
   </head>
 
   <body>
      <table border = '1' width = '100%'>
         <thead>
            <tr><td>
               <img src=" & JSON(Image1.Image,JSONFormat.IgnoreBinaryData ) &" height='65' width='65'></td>
               <td  colspan = '3'><b>Defects Report<b/> "& DataCardValue18.Text & " </td>
            </tr>
            <tr>
              
            </tr>
         </thead>
        
         <tfoot>
            <tr>
               <td colspan = '4'><b>* Refers to articulated lorry and trailer combinations.
** Refers to popular FORS elements. Please note that this is not a complete representation and reference should be made to your FORS accreditation level.<b/></td>
            </tr>
         </tfoot>
        
         <tbody>
            <tr>
               <td colspan = '4'><b>Driver''s Name:</b></td>
            </tr>
            <tr>
               <td colspan = '4'>"& DataCardValue17.Text &" </td>
            </tr>
            <tr>
               <td colspan = '4'><b>Vehicle / Fleet Number</b></td>
            </tr>
            <tr>
               <td colspan = '4'>"& DataCardValue18.Text &" </td>
            </tr>
            <tr>
               <td colspan = '4'><b>Odometer Reading</b></td>
            </tr>
            <tr>
               <td colspan = '4'>"& DataCardValue24.Text &" </td>
            </tr>
            <tr>
               <td colspan = '4'><b>Vehicle Defect report Date: <b/>"& DataCardValue23.SelectedDate &"</td>
            </tr>
             <tr>
               <td><b>Fuel / oil / Water leaks</b></td>
        <td><b>Battery Security</b></td>
               <td><b>Tyres / Wheels and Wheels Fixing</b></td>
               <td><b>Spray Suppression Devices</b></td>
               </tr>
            <tr>
               <td> "& DataCardValue26.Selected.Value &" </td>
               <td> "& DataCardValue28.Selected.Value &" </td>
               <td>"& DataCardValue30.Selected.Value &" </td>
               <td> "& DataCardValue33.Selected.Value &" </td>
               </tr>
            <tr>
               <td><b>Registration Plates</b></td>
               <td><b>Prominent External Warning Signage*</b></td>
               <td><b>Body and Wings Condition / Security</b></td>
               <td><b>Side Guards / Under-Run Protection**</b></td>
            </tr>
            <tr>
               <td> "& DataCardValue35.Selected.Value &" </td>
               <td> "& DataCardValue37.Selected.Value &" </td>
               <td> "& DataCardValue39.Selected.Value &" </td>
               <td> "& DataCardValue41.Selected.Value &" </td>
            </tr>
            <tr>
               <td><b>Brakes, Including ABS / EBS</b></td>
               <td><b>Air Build-Up / Leaks</b></td>
               <td><b>Steering</b></td>
               <td><b>Mirrors / Class IV (wide-angle) Class V (Proximity) / Class VI (forward mirrors)**</b></td>
            </tr>
            <tr>
               <td> "& DataCardValue43.Selected.Value &" </td>
               <td> "& DataCardValue45.Selected.Value &" </td>
               <td> "& DataCardValue47.Selected.Value &" </td>
               <td> "& DataCardValue49.Selected.Value &" </td>
            </tr>
            <tr>
               <td><b>'0' Licence Visible</b></td>
               <td><b>Camera and Detection Sensors**</b></td>
               <td><b>Cab Interior / Seat Belts</b></td>
               <td><b>Speedometer / Speed Limiter</b></td>
            </tr>
            <tr>
               <td> "& DataCardValue51.Selected.Value &" </td>
               <td> "& DataCardValue53.Selected.Value &" </td>
               <td> "& DataCardValue55.Selected.Value &" </td>
               <td> "& DataCardValue57.Selected.Value &" </td>
            </tr>
            <tr>
               <td><b>Excessive Engine Exhaust Smoke</b></td>
               <td><b>Tachograph / Sifficient Print Rolls</b></td>
               <td><b>Lights / Reflectors / Markers</b></td>
               <td><b>Indicators / Side Repeaters</b></td>
            </tr>
            <tr>
               <td> "& DataCardValue59.Selected.Value &" </td>
               <td> "& DataCardValue61.Selected.Value &" </td>
               <td> "& DataCardValue63.Selected.Value &" </td>
               <td> "& DataCardValue65.Selected.Value &" </td>
            </tr>
            <tr>
               <td><b>Tail-Lift and Safety Equipment**</b></td>
               <td><b>Warning Lamps / MIL</b></td>
               <td><b>Lenses (e.g. Fresnel)**</b></td>
               <td><b>Wipers / Washers / Horn</b></td>
            </tr>
            <tr>
               <td> "& DataCardValue67.Selected.Value &" </td>
               <td> "& DataCardValue69.Selected.Value &" </td>
               <td> "& DataCardValue72.Selected.Value &" </td>
               <td> "& DataCardValue74.Selected.Value &" </td>
            </tr>
            <tr>
               <td><b>AdBlue / EDF (if required)</b></td>
               <td><b>Windscreen / Glass / Visibility</b></td>
               <td><b>Load Security / Vehicle Height</b></td>
               <td><b>Brake Lines*</b></td>
            </tr>
            <tr>
               <td> "& DataCardValue76.Selected.Value &" </td>
               <td> "& DataCardValue78.Selected.Value &" </td>
               <td> "& DataCardValue80.Selected.Value &" </td>
               <td> "& DataCardValue82.Selected.Value &" </td>
            </tr>
            <tr>
               <td><b>Coupling Security*</b></td>
               <td><b>Electrical Connections</b></td>
            </tr>
            <tr>
               <td> "& DataCardValue85.Selected.Value &" </td>
               <td> "& DataCardValue10.Selected.Value &" </td>
            </tr>
            <tr>
               <td colspan = '4'><b>Defect Report Here:</b></td>
            </tr>
            <tr>
               <td colspan = '4'>"& DataCardValue11.Text &" </td>
            </tr>
            <tr>
               <td colspan = '4'><b>Defect Assessment and Rectification:</b></td>
            </tr>
            <tr>
               <td colspan = '4'>"& DataCardValue12.Text &" </td>
            </tr>
 </tbody>
 
</html>");SubmitForm(EditForm1)

 

Instruction on the onselect function for the not working flow

'TBTCreatefile,Convertfile,Createfile2'.Run("<!DOCTYPE html>
<html>
   <head>
      <title>HTML Table</title>
   </head>
 
   <body>
      <table border = '1' width = '100%'>
         <thead>
            <tr><td>
               <img src=" & JSON(Image4.Image,JSONFormat.IgnoreBinaryData ) &" height='65' width='65'></td>
               <td  colspan = '3'><b>ToolBox Talk Ref. <b/> "& DataCardValue13.Text & " </td>
            </tr>
            <tr>
              
            </tr>
         </thead>
        
         <tfoot>
            <tr>
               <td colspan = '4'><b> <b/></td>
            </tr>
         </tfoot>
        
         <tbody>
            <tr>
               <td colspan = '4'><b>Delivered By:</b></td>
            </tr>
            <tr>
               <td colspan = '4'>"& DataCardValue11.Text &" </td>
            </tr>
            <tr>
               <td colspan = '4'><b>Contract</b></td>
            </tr>
            <tr>
               <td colspan = '4'>"& Dropdown2.Selected.Result &" </td>
            </tr>
            <tr>
               <td colspan = '4'><b>ToolBox Talk Ref:</b></td>
            </tr>
            <tr>
               <td colspan = '4'>"& DataCardValue13.Text &" </td>
            </tr>
            <tr>
               <td colspan = '4'><b>VToolBox Talk Date: <b/>"& DateValue1.SelectedDate &"</td>
            </tr>
             <tr>
               <td colspan = '4'><b>Subject:</b></td>
            </tr>
            <tr>
               <td colspan = '4'>"& DataCardValue14.Text &" </td>
            </tr>
            <tr>
               <td colspan = '4'><b>No. of Attendees:</b></td>
            </tr>
            <tr>
               <td colspan = '4'>"& DataCardValue12.Text &" </td>
            </tr>
            <tr>
               <td colspan = '4'><b>Attendees:</b></td>
            </tr>
            <tr>
               <td colspan = '4'>"& DataCardValue16.Text &" </td>
           <tr>
               <td colspan = '4'><img src=" & JSON(TakenPic, JSONFormat.IgnoreBinaryData ) &" height='800' width='800'></td>
             
            </tr>
         
 </tbody>
 
</html>");SubmitForm(EditForm1)
 
Can anyone sugest a solution or noticed any mistake?
Thanks
2 REPLIES 2
Highlighted
Community Support
Community Support

Hi @Mouraj,

Based on the HTML Text and flow's configuration that you mentioned, I could not find any issue with it. I think the flow's configuration is correct.

Do you mean that the generated HTML file in your OneDrive folder from your two flows are both OK?

 

I have made a test on my side, and don't have the issue that you mentioned. Within your copied flow, please make sure the "File content" dynamic content within the File Content field of the "Create file 2" action is selected from above "Convert file" action.

 

In addition, please consider modify the File Name of your PDF file as below:

2.JPG

Set "File Name" field in your "Create file 2" action to following:

Vehicle_Defect_Report_@{utcNow()}.pdf

Note: Remove the space within the File Name. Or you could rename it as a different name.

Try above solution, check if the issue is solved.

 

Also please consider remove the "Create file 2" action from your copied flow, and then re-add a new "Create file" action of OneDrive folder in your flow, specify the File Name as above, and select the converted File Content from above "Convert file" action, save your flow. Then fire the flow from your canvas app again, check if the issue is fixed.

Note: Within your app, please make sure you have created a connection to your copied flow properly, and call the flow action through the copied flow connection rather than original one.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted

Unfortunately, it didn't work. I even try to create a new app on a different location with different destination and origin files but I have the same result. Good HTML files but blank PDF.  Can anyone suggest me another way to create the pdf file?

Thanks

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (13,942)