@WarrenBelz
Yes I think it wont save because everytime I create a data after clicking the save button the data will display on the gallery but when I closed my app then open again the data was not save here's my formula. I replace my dbo.Request to MasterCollection and dbo.RequestDetail to RequestDetailCollection
If(
_submittingRequest,
Concurrent(
Set(
_navMenuSelect,
""
),
//if editing a request, revise the record that is being edited, otherwise create a new one
Patch(
MasterCollection,
If(
_editingRequest,
LookUp(
MasterCollection,
Id = GalleryRequests.Selected.Id
),
Defaults(MasterCollection)
),
{
Id: Value(Id.Text),
Description: ItemDescriptionTxtInput.Text,
Team: TeamTextInput.Text,
Type: TypeOfRequestDropDown.SelectedText.Value,
Approver: Office365Users.UserProfile(Label1_10.Text).Mail,
ApprovalStatus: "Pending",
Amount: Value(TotalAmount.Text),
//PayTo: SupplierDropDown.SelectedText.Value,
Company: TeamTextInput_2.Text,
InvoiceNumber: InvoiceNumber.Text,
PayTo: SupplierComboBox.Selected.Name,
//Supplier: SupplierDropDown.SelectedText.Value,
VAT: VATDropdown.SelectedText.Value,
TransactionDate: transactionDate.SelectedDate,
// ChargeToAccount: PaymentChargeAcct,
SpecialPaymentInstruction: SpecialPaymentTxtInput.Text,
Requester: User().Email,
Status: 1,
RequesterName: User().FullName,
Image: AttachmentTextInput.Text,
DueDate: StartDatePicker.SelectedDate,
ApproverName: Office365Users.UserProfile(Label1_10.Text).DisplayName,
Department: DepartmentComboBox.Selected.Result,
Project: ProjectComboBox.Selected.Result,
Program: ProgramComboBox.Selected.Result,
Activity: ActivityComboBox.Selected.Result,
VendorCode: supplier.Text
//Department: DepartmentDropDown_1.SelectedText.Value,
//Project: ProjectDropDown_2.SelectedText.Value,
//Program: ProgramDropdown.SelectedText.Value,
//Activity: ActivityDropDown_3.SelectedText.Value,
}
)
);
PowerAppsbutton_2.Run("Request", "N/A", User().Email, GalleryRequests.Selected.Id);
);
ForAll(
AddDetail,
Patch(
RequestDetailCollection,
Defaults(RequestDetailCollection),
{
RequestId: Last(MasterCollection).Id,
Amount: Value(PaymentAmt),
ChargeToAccount: PaymentChargeAcct,
Status: 1,
BusinessUnit: BusinessUnit,
Department: Department,
Program: Program,
Project: Project,
Activity: Activity,
AcctCode: AcctCode.Text
}
)
);
If(
!_editingRequest,
Flow20200324.Run(Last(MasterCollection).Id),
Flow20200324.Run(_selectedGalleryRequests.Id)
);
//reset all user input fields
Concurrent(
Set(
_submittingRequest,
false
),
Set(
_SequenceNumber,
""
),
Set(
_ItemDescription,
""
),
Set(
_Amount,
""
),
Set(
_SpecialPayment,
""
),
Set(
_ImageFile,
""
),
Reset(AttachmentTextInput),
Reset(SpecialPaymentTxtInput),
Reset(AmountTxtInput),
Reset(ItemDescriptionTxtInput),
Reset(InvoiceNumber)
);
Set(
_SelectApprover,
false
);
Set(
_nSelectedApprover,
true
);