cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
u4jaanus
Resolver I
Resolver I

Submit Form items along with Collection to Sharepoint

Hi 

I have a Screen with a form containing different TextFields and a data table (which fetches data from a Collection named "ProductsCollection"). Need to submit From data along with Collection to sharepoint list my code is below.

 

 

ForAll(ProductsCollection,
 Patch(ShopOrders,
  {Date:CustomerPageDate.SelectedDate,
   Rep:User().FullName,
   CustomerAccount: AccInput.Text,
   CustomerName:CustomerNameInput.Text,
   ProductCode:ProductsCollection.Code,
   ProductName:ProductsCollection.Name,
   Qty:ProductsCollection.Qty}));

 


  

I am getting Type error on ProductCode. As it is expecting text but getting table.

 

Update:

I tried using ProduceCode:First(ProductCollection).Code...

However what this does is; it only takes the 1st value of Code for each row. 

1 ACCEPTED SOLUTION

Accepted Solutions
u4jaanus
Resolver I
Resolver I

Found the solution myself.
ForAll(ProductsCollection,
Patch(ShopOrders,
  {Date:CustomerPageDate.SelectedDate,
   Rep:User().FullName,
   CustomerAccount: AccInput.Text,
   CustomerName:CustomerNameInput.Text,
   ProductCode:ProductsCollection.Code, Do not need to again Call the Collection name here.
   ProductName:ProductsCollection.Name, Do not need to again Call the Collection name here.
   Qty:ProductsCollection.Qty})); Do not need to again Call the Collection name here.

 

Instead can directly call the column name of collection as we already have called the Collection when used ForAll above.
Correct solution would be.

ProductCode:Code

ProductName:Name
Qty: Qty

View solution in original post

1 REPLY 1
u4jaanus
Resolver I
Resolver I

Found the solution myself.
ForAll(ProductsCollection,
Patch(ShopOrders,
  {Date:CustomerPageDate.SelectedDate,
   Rep:User().FullName,
   CustomerAccount: AccInput.Text,
   CustomerName:CustomerNameInput.Text,
   ProductCode:ProductsCollection.Code, Do not need to again Call the Collection name here.
   ProductName:ProductsCollection.Name, Do not need to again Call the Collection name here.
   Qty:ProductsCollection.Qty})); Do not need to again Call the Collection name here.

 

Instead can directly call the column name of collection as we already have called the Collection when used ForAll above.
Correct solution would be.

ProductCode:Code

ProductName:Name
Qty: Qty

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (986)