cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Daves1
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
sumurthy
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
ChristianAbata
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
sumurthy
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
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Users online (53,983)