Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
Unanswered

PATCH AND COLLECT FUNCTION ISSUE

(0) ShareShare
ReportReport
Posted on by 12

All About Community Badges 

I am a new developer in power apps.

 

I have 2 lists; 'Product List' & 'Sub FJO'. I have 1 column in sharepoint called "product name" in the Sub FJO list (it is a lookup column which gets the data from the master list 'Product List'.

 

I have tried a similar approach to this article here for reference: Repeating Tables in Power Apps using SharePoint List Form 2.0 (anjcerbolles.com) 

 

I have been trying to get the combo box to work with the collect and clear collect. 

 

The issue is that when i add a new row in the gallery, the combo box data for row 1 disappears. I then later have to add the values again to the combo box after adding several columns. The patch does work correctly.

 

Clear Collect Function:

 

NewForm(CreateItemForm);
ClearCollect(
colInvoice,
{
LineItem: "",
LinePrice: "",
LineQty: "",
LinePayment: false,
LineProduct: ""
}
);
Set(
SharePointFormMode,
"CreateForm"
);
Navigate(
CreateScreen,
Transition.None
)

 

Combo Box Items Function: 

 

Choices([@'FJO - Sub FJO'].ProductName)

 

Patch Function:

 

Patch(
colInvoice,
ThisItem,
{
LineItem: txtItemNameCreate.Text,
LinePrice: Value(txtPriceCreate.Text),
LineQty: Value(txtQtyCreate.Text),
LineProduct: ComboBox4.Selected.Value
}
);
Collect(
colInvoice,
{
LineItem: "",
LinePrice: "",
LineQty: "",
LinePayment: false,
LineProduct: ""
}
)

 

Form Submission on Success Function: 

 

ForAll(
CreateGalleryItems.AllItems,
If(
!IsBlank(txtItemNameCreate.Text),
Patch(
'FJO - Sub FJO',
Defaults('FJO - Sub FJO'),
{
Title: CreateItemForm.LastSubmit.Title,
'Sub FJO Number': txtItemNameCreate.Text,
'TEST COLUMN': Value(txtPriceCreate.Text),
Quantity: Value(txtQtyCreate.Text),
'Product Name': ComboBox4.Selected
}
)
)
);
ResetForm(Self);
RequestHide();

 

 

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Microsoft Dataverse

#1
stampcoin Profile Picture

stampcoin 17

#2
ankit_singhal Profile Picture

ankit_singhal 11 Super User 2025 Season 1

#3
mmbr1606 Profile Picture

mmbr1606 9 Super User 2025 Season 1

Overall leaderboard

Featured topics