简体   繁体   English

电源应用 | 将图库保存到 SharePoint 列表时出现问题

[英]PowerApps | Issue in saving Gallery to SharePoint list

I have a simple vertical gallery control with five controls.我有一个带有五个控件的简单垂直画廊控件。 I am trying to use the below piece of code to save all the rows in gallery to a SharePoint list but I am getting null values.我正在尝试使用下面的代码将图库中的所有行保存到 SharePoint 列表,但我得到 null 值。 在此处输入图像描述

Assuming Logistics is the name of your SharePoint list, you need to use the Patch overload that has 3 arguments to insert items into the list:假设Logistics是您的 SharePoint 列表的名称,您需要使用具有 3 arguments 的 Patch 重载将项目插入列表:

ForAll(
    addLogistics.AllItems
    Patch(
        Logistics,
        Defaults(Logistics),
        {
            Title: "123",
            Lot_Number: txtLotNumber.Text,
            Nr_Packs: txtPacks.Text,
            Actual_Weight: txtWeight.Text,
            Sealed: ddSealed.Selected
        }
    ));

You need to add < Defaults(Logistics), > as a second argument in your Patch Function您需要在补丁 Function 中添加 < Defaults(Logistics), > 作为第二个参数

If the text box and drop down controls are inside of gallery, repeating for each item in gallery, you should use the data from gallery items instead of referencing values from controls如果文本框和下拉控件在库内,对库中的每个项目重复,您应该使用库项目中的数据而不是引用控件中的值

For example:例如:

ForAll(
    addLogistics.AllItems
    Patch(
        Logistics,
        Defaults(Logistics),
        {
            Title: "123",
            Lot_Number: ThisRecord.LotNumber,
            Nr_Packs: ThisRecord.NrPacks,
            Actual_Weight: ThisRecord.ActualWeight,
            Sealed: ThisRecord.Sealed.Value
        }
    )
);

Note : Use actual column names at the right hand side instead of LotNumber , NrPacks , ActualWeight , etc.注意:在右侧使用实际的列名称,而不是LotNumberNrPacksActualWeight等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM