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

Form to Excel, import graph according to excel sheet to populate Word template

Hi all

I have a flow that based on the responses received on a form> form is populated into an excel. The second sheet of this excel generates a chart that I would like to populate within a word sheet how can I do this? Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft
Microsoft

Get Charts as image is possible. 

Check out this link for full details - 

https://github.com/sumurthy/officescripts-projects/tree/main/Chart%20and%20Table%20Images

 

It uses Office Scripts to extract the images as base64 that you can then email. 

 

View solution in original post

4 REPLIES 4
Super User II
Super User II

hi @Daves1  get Charts as images is not possible sorry. Could be a great idea you can post it here

Power Automate Ideas - Power Platform Community (microsoft.com)



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
Microsoft
Microsoft

Get Charts as image is possible. 

Check out this link for full details - 

https://github.com/sumurthy/officescripts-projects/tree/main/Chart%20and%20Table%20Images

 

It uses Office Scripts to extract the images as base64 that you can then email. 

 

View solution in original post

Thank you @sumurthy  since the graph is already generated, will it be enough to insert this last part of the script?

 

function updateRange(sheet: ExcelScript.Worksheet, data: string[][]): ExcelScript.Range {

  const targetRange = sheet.getRange('A1').getResizedRange(data.length-1, data[0].length-1);

  targetRange.setValues(data);

  return targetRange;

}

 

interface ReportImages {

  chartImage: string

  tableImage: string

}

 

 

I am resuming this thread because I am trying to create a code with Office script on excel online.
The code is as follows:

function main (workbook: ExcelScript.Workbook) {
  declare function require (name: string);
  let Sheet2 = workbook.getWorksheet ("Sheet2");
  var rang = Sheet2.getRanges ("J2: Q16");
  var ch = Sheet2.ChartObjects (). Add (rang.Left + rang.Width, rang.Top, 350, 220);
  ch.Chart.ChartType = 4;
  ch.Chart.SetSourceData (rang, 2);
  chartImage = ch.getImage ();
} 

but I get the following error: runtime error: Line 5: Sheet2.ChartObjects is not a function
clientRequestId: .....

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Microsoft Ignite

Microsoft Power Platform: 2021 Release Wave 1 Plan

Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (17,450)