有点新手:PowerApps 用构造的数据字段填充列表

Kinda newbie: PowerApps to populate a list with constructed data fields

已更新...

尝试通过 PowerApps 将一系列行插入到 SharePoint 列表中,但 运行 事实上 PowerApps 似乎只有 FORALL 作为循环函数,而且不支持 SET。

   Set(AlertString,""); // to be used later
   Set(REQ_Value,"");
   Set(RITM_Value,"");
   Set(Asset_Value,"");
   Set(CustomerSignatureFileLocation_Value,"File location: ");
   Set(LoanerKitCode_Value,"");
   Set(IncidentCode_Value,"");
   Set(TransferOrderCode_Value,"");
   Set(TransactionType_Value,Workflow.SelectedText.Value & " - " & Workflow_Steps.SelectedText.Value);
   Set(ScanItemCodeType,"");
   Set(ErrorString,"");
   Collect(ScanDataCollection,Split(ScanData.Text,Char(10))); // Split the data into ScanDataCollection collection
   ForAll(
       ScanDataCollection,
       If(Left(Result,4)="RITM",Set(RITM_Value,Result); // FAIL HERE
       Collect('Spider - Master Transaction List', {
           REQ: REQ_Value,
           RITM: RITM_Value,
           Scan_Code: Result,
           Asset: Asset_Value,
           Transaction_Type: TransactionType_Value,
           Timestamp: Now(),
           Agent_Name: User().FullName,
           Agent_Email: User().Email,
           Agent_Location: DD_Location.SelectedText.Value,
           Agent_Notes: "It was weird, man.",
           Customer_Name: Cust_Name.Text,
           Customer_Email: Cust_NTAccount.Text,
           Customer_Signature: CustomerSignatureFileLocation_Value,
           Task_Name: "",
           Task_Action: "",
           State_Name: "",
           State_Action: "",
           Stage_Name: "",
           Stage_Action: "",
           Work_Note_String: "",
           Customer_Note_String: "",
           Loaner_Kit_Code: LoanerKitCode_Value,
           Incident: IncidentCode_Value,
           Transfer_Order_Code: TransferOrderCode_Value,
           Item_Description: ""});
   );

我的扫描仪工具会扫描各种不同类型的物品,所有这些都在同一次扫描中。根据数据的类型,它会填充 Spider - Master Transaction List 中的不同列。

但是我们禁止在 FORALL 中使用 SET 函数。

考虑到来自 SPLIT 的每条数据都可以是任何类型的代码(例如 RITM 代码、REQ 代码、转移订单代码等),您建议我如何处理这个问题?

你可以通过各种方式来做你想做的事情。

使用 Collection 或 Gallery,在 powrapps Galleries 中可以像 collection 一样使用。

我建议:

ForAll(
  Gallery.Allitems, 
  Patch(
   'SharepointListName',      
   ThisRecord
  )
);

库中的字段必须与共享点列表具有相同的名称,否则您必须创建一条记录来分配名称。

{sharepoitColumnName: ThisRecord.ColumnName, ...}