power APP 用COLLECT 函数写入SHAREPOINT 之后,如何获取其ID?

https://powerusers.microsoft.com/t5/Building-Power-Apps/Get-ID-from-the-new-created-record-using-collect/td-p/972113

微软上面有人问,但是没有看到答案

you have specified the fields and that is all that is in it. When you Patch to SharePoint, 说要指定序列号

如果数据库写入的话, 如何获取系统最大记录呢?

ID: Text(CountRows(Expenses2) + 1), 这种写法sharepoint 不支持,且非常慢

那么如何获取序列号ID 从SHAREPOINT 里面呢?

https://powerusers.microsoft.com/t5/Building-Power-Apps/Display-Next-SharePoint-ID/td-p/169600

, ID: First(Sort(Expense_Reimbursement_Headers,ID,Descending)).ID+1 这个方法不行,写不进去.

反过来考虑,让系统自动写入, 然后把ID 取出来行吗?

//Update(SelectedReport.ID, Last(Expense_Reimbursement_Headers).ID);

先用collect 写入SHAREPOINT , 然后用

Patch( SelectedReport, Last(Expense_Reimbursement_Headers), { ID: Last(Expense_Reimbursement_Headers).ID } );

似乎可以了,哈哈

Last(Expense_Reimbursement_Headers) 这个语句只能取表的数据, 不能取RECORD的数据。

SelectedReport 加一个ID, ID值是刚写入表这条记录, 值也是刚写入表这条记录的值。好绕口的感觉

Leave a Reply

Your email address will not be published. Required fields are marked *