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 Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (1,674)