Hello! I am close to figuring out this expense report app but have run into a couple of issues and really need some help.
I have a form to collect the parent information from an Invoice (Datasource = SharePoint List1): InvoiceEntryForm
I then have a Gallery that collects the child items from that Invoice (Datasource = SharePoint List2): LineItemGallery
The line items of the gallery are added to a collection:
ExpenseCollection = ClearCollect(ExpenseCollection, {EventName: "", ExpenseTypeCollect: "", ItemCost: 0, BusinessUnit: "", CostCenter: ""});
When I Submit...
1- the form submits - SubmitForm(InvoiceEntryForm)
2 - OnSuccess of the Form submission, the collection is patched:
ForAll(ExpenseCollection, If(!IsBlank(EventName),Patch(Datasource2, Defaults(Datasource2),
{'Event Name': EventName, 'Item Cost': ItemCost, BusinessUnit: BusinessUnit, 'Cost Center': Value(CostCenter), MasterID: InvoiceEntryForm.LastSubmit.ID})))
I'm having issues with the Expense Type field.
Expense Type:
Items: Choices(Datasource2.ExpenseType)
Default: ThisItem.ExpenseTypeCollect
In my SharePoint list this is set up as a Choice field.
While there does not seem to be an issue with adding it to the collection, I cannot for the life of me get it added to the patch.
When I add 'Expense Type': ExpenseTypeCollect, the App Checker tells me that "The type of this argument 'ExpenseType' does not match the expected type 'Record'. Found type 'Text'."
I have tried:
'Expense Type': ExpenseTypeCollect.Value
'Expense Type': ExpenseTypeCollect.Selected.Value
'Expense Type': ExpenseTypeCollect.Text
'Expense Type': Value(ExpenseTypeCollect)
Thanks in advance for any help you can provide!