本文介绍了强大的自动化功能:将Excel OneDrive表复制到另一个Excel OneDrive表的底部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正试图找出如何将所有数据从OneDrive excel表复制到另一个OneDrive excel表的方法.只需将数据粘贴到表格底部即可.这两个表具有相同数量的列和数据类型.

I am currently stuck trying to figure out how to copy all data from a OneDrive excel table to another OneDrive excel table. Simply paste data to the bottom of the table. Both tables have the same amount of columns and data types.

  • 从Excel OneDrive文件(文件1)复制表
  • 将另一张表底部的数据粘贴到另一个OneDrive excel文件(文件2)

希望有人可以帮助我解决这个问题.它看起来很简单.以下是我当前的电源自动化流程

Hoping someone could help me figure this out. Its seems very simple. Below is my current Power Automate Flow

推荐答案

您可以使用Office脚本来实现.

You can use Office Scripts to achieve this.

对于运行脚本,我有

function main(workbook: ExcelScript.Workbook) {
  const sheet = workbook.getWorksheets()[0];
  let lastRow = sheet.getUsedRange(true).getLastCell().getRowIndex() + 1;
  let rng = "A3:P" + lastRow
  let tableTest = sheet.getRange(rng).getValues();
  console.log(tableTest);
}

然后在撰写下

@{outputs('Run_script')?['body']?['Logs'][0]}

然后初始化"RemoveString";变量

Then Initialize the "RemoveString" variable

@{split(outputs('Compose'),' ')[0]}

然后初始化"NewString";变量

Then Initialize the "NewString" variable

@{replace(outputs('Compose'),variables('RemoveString'),'')}

然后运行脚本2并添加"NewString"作为参数.

Then Run Script 2 and add "NewString" as the parameter.

function main(workbook: ExcelScript.Workbook, rangeTest: string) {
  let table = workbook.getTable("BacklogTable");
  let str = rangeTest;
  let testerTest = JSON.parse(str);
  table.addRows(null, testerTest);
}

RemoveString的原因是删除日期&输出中的时间戳记

The reason for RemoveString is to remove the Date & Time Stamp from the outputs

如果您想了解有关Office脚本和添加到工作表的更多信息,可以查看Microsoft的PM Sudhi Ramamurthy的YouTube视频之一,此处.

If you want to learn a little more about Office Scripts and adding to worksheets, you can check out one of Microsoft's PMs Sudhi Ramamurthy's YouTube video here.

这篇关于强大的自动化功能:将Excel OneDrive表复制到另一个Excel OneDrive表的底部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 12:56