web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patching Collection Is...
Power Apps
Unanswered

Patching Collection Issues Local Collection Coming Up Blank

(0) ShareShare
ReportReport
Posted on by 10

Hello Everyone, this one might be a bit long so I can kind of describe how I have things set up. I'm still fairly new to PowerApps so if I have something set up incorrectly, please let me know, open to all criticism haha.

 

So I am creating an expense report application that has multiple screens it goes through before submitting the data to a sharepoint datasource. I am using collections because I am creating multiple line items attached to a specific expense report, but for some reason when creating the line item it's not patching anything when I test locally. 

 

On my home page, I have a Gallery that I have called Gallery3 that pulls the information from the sharepoint datasource to display the specified users expense reports. You have an option to create a new expense report, or go into the specified report that you want. When creating a new expense report, this is the following code I have for that: 

 

Set(LastScreen, "Home Screen");NewForm(Form2);Navigate('Create Expense Report', ScreenTransition.Cover);ClearCollect(ExpenseReports, {ID: 0, Title: "", Date: Today(), Comment: "", UserName: "", ExpenseName: "", ExpenseType: "", PaymentMethod: "", ExpenseCost: "", Receipt: ""})

 

 

Once on the next screen, you're able to create a new expense report with the options of "Report Name", "Transaction Date", and "Requestor Comment" with the option to cancel or create the new report. When creating the new report, this is the following code I have for that: 

 

Set(LastScreen, "Create Expense Report");SubmitForm(Form2);Collect(ExpenseReports, {ID: Gallery3.Selected.ID, Title: ReportNameInput.Text, Date: DateValue(DateValue3), Comment: RequestorComment.Text, UserName: Requestor.Text});Navigate('Expense Report Page', ScreenTransition.Cover)

 

 

On the next page is the actual expense report screen, you can get to this screen from the line item on the first screen or when you create a new report. On the top it had the details of the report obtained in a switch statement depending on which page you are coming from. Example: 

 

Switch(LastScreen, "Home Screen", Gallery3.Selected.'Expense Report Number', "Create Expense Report", Form2.LastSubmit.'Expense Report Number', "New Line Item", Gallery3.Selected.'Expense Report Number')

 

At the bottom of the page is where it's supposed to display the specified expense attached to the whole report. I have a gallery that is attached to my collection with a button to create a new line item. In the new line item is where I seem to be having issues. In here it displays the Report Name, Requestor, and Transaction Date that was saved before, and then has the user input the Expense name, image of a receipt, Expense Type (Dropdown), Payment method used (Dropdown), and Expense Cost. Once all that information is all filled in there is a "Submit Expense" button down at the bottom that has the following code:

 

Set(LastScreen, "New Line Item");Navigate('Expense Report Page', ScreenTransition.Cover);Patch(ExpenseReports, LookUp(ExpenseReports, ID = Gallery3.Selected.ID), {ExpenseName: ExpenseNameInput, ExpenseType: ExpenseTypeInput, PaymentMethod: PaymentMethodInput, ExpenseCost: Value(ExpenseCostInput.Text), Receipt: UploadedImage1.Image});

 

This then takes you back to the Expense Report screen, but when there the line items aren't populating with the data from the collection and when checking the collection, all the fields are blank. This is the data in the line items that should be updated.

 

Title - ThisItem.ExpenseName
Subtitle - Text(ThisItem.ExpenseCost, "$#,###0.00")

 

Both of those are coming up blank as well as the data in the collection is empty. Once I got the line items to get data correctly, I was going to patch my sharepoint document with all the information in the collection and the multiple line items.

 

I'm sure I may have set some of this up incorrectly because I'm still pretty new to how PowerApps works, so any assistance would be helpful. Please let me know if you need anymore information about this. 

Categories:
  • KrypticSloth Profile Picture
    10 on at

    Any assistance would be appreciated as this is for a project I am working on. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 258

#3
Mohsin Ali Profile Picture

Mohsin Ali 231

Last 30 days Overall leaderboard