in power apps on buttonselect, has to execute two flows, one is insert and second is update. insert flow is executing and update flow is skipping.
In power apps using tables from azure databricks. created flows using parse Json for insert and update.
Delete__DEP.Run(TextInput2_4.Text);
Refresh('TableDEP');
If(IsBlank(DatePicker4.SelectedDate) || IsBlank(TextInput15_5.Text), Notify("message ",NotificationType.Error),
If(CountRows(checkescdep) =0
,Notify("Please Select at least one Escalation Check Box",NotificationType.Warning),
With(
{
_sr_log_ref: TextInput2_4.Text,
_datewithnsp: TextInput15_3.Text,
_i
},
ForAll(
checkescdep,
Collect(
colPayloadNSP,
{
so_item_impact: PartNumber,
sales_order: OrderType,
line_number: LineNumber,
sr_log_ref: _sr_log_ref,
datewithnsp: _datewithnsp,
}
)
)
);
Set(varNSPDEPflow,
!IsError( ForAll(colPayloadNSP,INSERT.Run(JSON(ThisRecord,JSONFormat.IgnoreUnsupportedTypes) ) ) ) );
Set(varNSPDEPupdate,If(varNSPDEPflow,!IsError(
Set(
payloadupdate,
{
sr_log_ref: SelectedSR,
detailed_comment: ip_SRDetails_Detailed_Comments.Text,
nsp_closurecomments: TextInput9_8.Text
}
);
UPDATE.Run(JSON(payloadupdate, JSONFormat.IncludeBinaryData));
),false));
//Set(varNSPDEPupdate,If(varNSPDEPflow, !IsError(SR_UPDATE.Run(JSON(payloadupdate, JSONFormat.IgnoreUnsupportedTypes))),false));
If(varNSPDEPflow, varNSPDEPupdate, Set(varShowPopupDEPES,true),
Notify("Flow Execution failed SR is not Escalated, Some field values are empty",NotificationType.Error)
)));
Clear(colpartdata);
Clear(checkescdep);
Set(varDEPSelectAll,false);
Reset(DatePicker4);
Reset(TextInput15_5);
given some field values only. insert part executing, update skipping.