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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

For All and Patch Function, need help.

(0) ShareShare
ReportReport
Posted on by 8

Hi Experts,

 

I have a form called Sales order form that is connected to the share point list Sales Order.  My goal is to document orders sent by a team member from the Sales order form with the functionality of having multiple rows for Product, Quantity, Product Colour and Supplier.  Using Shane's powerapps911 on you tube (part 1 to 3 to build infopath like app), I have designed the app similar to the usages but I'm stuck in the logic.

 

I have used a collection to collect the multiple rows.  I can see these collections in the app.  If i just use the edit form, I can see that the data is found and collected.  I am having issues with this formula and i'm not sure where the problem is, as when its submitted, the collection isn't added into the list.

 

ForAll(
ProductOrderCollection,
Patch(
'Sales Order',
Defaults('Sales Order'),
{
ProductOrdered: Product_Order,
ProductColour: Product_Colour,
Supplier: Product_Supplier,
Quantity: Product_Qty,

}

)

)

 

VarunNayak_2-1627398657157.png

 

I am using the Edit form for the left hand side and a gallery for the right hand.

 

VarunNayak_1-1627398590750.png

Can anyone help ?

I have the same question (0)
  • Power Platform Communities Profile Picture
    8 on at

    I can”t help you directly cause I’m not to much in power apps. But did you consider using a model driven app? It would be super simple to do header/line structured data

  • Power Platform Communities Profile Picture
    8 on at

    No, I haven't considered using a model driven app.

  • Power Platform Communities Profile Picture
    8 on at

    OK, So my app was somehow deleted.  Not sure why.  But I've re-created the setup but only to this issue previously.  It is working to an extent. 

     

    This is my current formula:

     

    ForAll(ProductMultiOrder,Patch('Sales Order',Defaults('Sales Order'), {ProductOrdered:Customer_Product, Quantity:Value(Customer_Qty), ProductColour:Customer_Colour, Supplier:Customer_Supplier, ID:New_Form.LastSubmit.'Master ID'}))

     

    I've found that it works if i remove the ID element of the file but i get 2 rows minimum when i want one.  I put in the Master ID because i wanted the same Customer to be filled in if there is multiple orders.  Below is a picture of how its submitting in the share point list.

     

    VarunNayak_0-1627706522651.png

    I need the customer details (Product, product colour, product qty, product supplier) to be multiplied while the customer master info (name, email etc) is the same.  What its doing now is 3 rows where i would need 2 and i need the customer fields populated.

     

    Can anyone help me ?

  • Power Platform Communities Profile Picture
    8 on at

    I've been following the tutorials from Shane powerapps911:

     

    https://www.youtube.com/watch?v=xgznk4XlPCo&t=787s

     

    So i've added the blank logic so i don't get a blank line in sharepoint.

     

    New formula:

    ForAll(ProductMultiOrder,If(!IsBlank(Customer_Product) ,Patch('Sales Order',Defaults('Sales Order'), {ProductOrdered:Customer_Product, Quantity:Value(Customer_Qty), ProductColour:Customer_Colour, Supplier:Customer_Supplier})))

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 74

#3
Martin Dráb Profile Picture

Martin Dráb 64 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans