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

Get and update EXCEL data after Submit form

Hi Everyone:

     I have a flow start with a form, and people need to upload 1 excel file when they submit the form, I want to get some fixed cell's info after people upload the excel, such as A1,B1,C1, how can I get them and update it to a table in other excel file?

  Such as:

   1.I have a excel file named "A" in my One drive folder, it has a table named "B"; 

   2. Upload a excel file named "C" when submit the form, it has cells A1,B1 and C1, and B1 is the date, such as "2021-11-27", and the C1 is a link, such as "https://www,google.com";

   3.Get the A1,B1,C1 data in the "C" and then update the data to "B", the A ;

How can I achieve step 3? Looking forward to your reply.

 

1 ACCEPTED SOLUTION

Accepted Solutions
iltoningui
Resolver IV
Resolver IV

Hi @york 

 

I was able to achieve this using the run script action, you need to

1. Create an excel script on web, follow this tutorial 

function main(workbook: ExcelScript.Workbook): ReadData
{
  // get active sheet
  const sheet = workbook.getActiveWorksheet();
  // get data from A1
  let name: string = sheet.getCell(0, 0).getValue() as string;
  // get data from B1
  let date: string = sheet.getCell(0, 1).getValue() as string;
  // logs the operation
  console.log(name)
  console.log(date)
  //creates an object to return the data
  let data: ReadData = new ReadData(name, date);
  return data;
}

class ReadData {
  name: string;
  date: string;

  constructor(name: string, date: string){
    this.name = name;
    this.date = date;
  }
} 

2. Create the flow

iltoningui_0-1638069304890.png

outputs('Run_script')?['body/result/name']

this will get the name attribute returned by the script

 

Hope this helps

 

Consider marking it as a solution

View solution in original post

1 REPLY 1
iltoningui
Resolver IV
Resolver IV

Hi @york 

 

I was able to achieve this using the run script action, you need to

1. Create an excel script on web, follow this tutorial 

function main(workbook: ExcelScript.Workbook): ReadData
{
  // get active sheet
  const sheet = workbook.getActiveWorksheet();
  // get data from A1
  let name: string = sheet.getCell(0, 0).getValue() as string;
  // get data from B1
  let date: string = sheet.getCell(0, 1).getValue() as string;
  // logs the operation
  console.log(name)
  console.log(date)
  //creates an object to return the data
  let data: ReadData = new ReadData(name, date);
  return data;
}

class ReadData {
  name: string;
  date: string;

  constructor(name: string, date: string){
    this.name = name;
    this.date = date;
  }
} 

2. Create the flow

iltoningui_0-1638069304890.png

outputs('Run_script')?['body/result/name']

this will get the name attribute returned by the script

 

Hope this helps

 

Consider marking it as a solution

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.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (6,549)