强大的应用-无法按时读取数据

时间:2019-05-21 12:32:40

标签: powerapps powerapps-formula powerapps-collection powerapps-canvas

我有一个保存按钮,该按钮从屏幕对象(文本输入)中获取值,如果满足所有条件,则将其加载到SharePoint列表中。

代码如下所示

//identify the required organization and Dropdown value
    Set(requiredOrganization,Organization.Selected.OrganizationName.Text);
    Set(DropdownValue, Trim(Dropdown1.SelectedText.Value));

    If(DropdownValue = "Others", Set(segmentrationalrequired,"Others:" & TextInput3_1.Text),Set(segmentrationalrequired,DropdownValue));


//Identify the Audit Details - // Audit Trail Update
    If(TextInput2_48.Text = "", Set(AuditTrail,TextInput2_48.Text) , Set(AuditTrail, TextInput2_48.Text & Char(13)));
    Set(UpdatedAuditTrail, AuditTrail & "Allocated By " & User().FullName & " on " & Substitute(Text(Now()),":","-") & ". ");

//Update the Graph
        ClearCollect(CurrentYearAllocationsGraphFinal2, 
        {Category: Label11_17.Text, 'Upcoming Year':TextInput2_8.Text,'Current Year':TextInput2_32.Text},
        {Category: Label11_18.Text, 'Upcoming Year':TextInput2_9.Text,'Current Year':TextInput2_33.Text},
        {Category: Label11_19.Text, 'Upcoming Year':TextInput2_10.Text,'Current Year':TextInput2_34.Text},
        {Category: Label11_20.Text, 'Upcoming Year':TextInput2_11.Text,'Current Year':TextInput2_35.Text});

//Save the value in the Sharepoint List
        If(And(Label11_23.Text = "100", segmentrationalrequired <> "",segmentrationalrequired <> "Others:",DropdownValue<>Blank(),TextInput2_37.Text <>""), Patch(Table1,
        First(Filter(Table1, 'Organizational Code by Function Head' = requiredOrganization)),
        {'100 or Less': (Value(TextInput2_8.Text))/100}, 
        {'Premier (100 - 4,999)': (Value(TextInput2_9.Text))/100}, 
        {'NAO (>5,000)': (Value(TextInput2_10.Text))/100}, 
        {Association: (Value(TextInput2_11.Text))/100},
        {'Segment Rationale': segmentrationalrequired},
        {'Current Status':"Ready to be Sent for Approval"}, 
        {'Allocated By' : User().FullName},
        {'Segment Rationale File Details':TextInput2_37.Text}, 
        {'Allocated On': Now()}, 
        {'Audit Details': UpdatedAuditTrail}
        ),
        Notify("Allocations must total 100%. Please include your Allocation Methodology and Link to Segment Rationale"));

//Refresh if Successful
        If(And(Label11_23.Text = "100", segmentrationalrequired <> "",segmentrationalrequired <> "Others:",DropdownValue<>Blank(),TextInput2_37.Text <>""),
        Refresh(Table1) & Refresh(Table4) & Set(default_gallery_Market,First(Filter(Table1, 'Organizational Code by Function Head' = requiredOrganization))));

现在,此处的代码有效。但有时即使满足所有必需条件,它也会向我抛出通知消息。我的理解是屏幕,即使它在显示屏上显示值,也不能完全加载到对象中。

因此,如果我单击“保存”按钮旁边的某个位置,然后再单击“保存”,它将再次保存它。

有没有一种方法可以避免此问题。计时器会解决这样的问题吗?

请让我知道您的建议并解决。

0 个答案:

没有答案