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.
Solved! Go to Solution.
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
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
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
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
User | Count |
---|---|
93 | |
44 | |
21 | |
17 | |
16 |
User | Count |
---|---|
137 | |
50 | |
42 | |
39 | |
29 |