cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper 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
Highlighted
Helper I
Helper I

Re: Submit Form items along with Collection to Sharepoint

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
Highlighted
Helper I
Helper I

Re: Submit Form items along with Collection to Sharepoint

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (5,740)