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

Community site session details

Session Id : bEXoqTy5tVWVYhhHOz5ndE
Power Apps - Microsoft Dataverse
Unanswered

PATCH AND COLLECT FUNCTION ISSUE

Like (0) ShareShare
ReportReport
Posted on 20 May 2022 05:53:52 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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Featured topics

Loading complete