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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to multiple values...
Power Apps
Answered

How to multiple values in a collection?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi all,

 

I'm creating an app with repeating tables. All my fields are working except the multiple field. The field is working but the values are not in the collecting so my SharePoint list doenst get the data. First i make an collect from start:

 

 

NewForm(Form1);ClearCollect(ExpenseCollection, {LineItem: "", LineCost: 0, LineCount: 0, LineTotal: 0}) ;Navigate(NewItem, ScreenTransition.Cover)

 

Collecting.png 

When i select the total field en select Default, i choose: LineCount*LineCost, the number multiple but the collection doenst know which field i need to update. How can i combine the formula LineCounst*LineCost and use default LineTotal? The app need to know which field needs to store the date. 

 

Here is my code for every new line, this works all fine:

 

Patch(ExpenseCollection, ThisItem, {LineItem: inputItem.Text, LineCost: Value(inputCost.Text), LineCount: Value(inputAantal.Text), LineTotal: Value(inputTotal.Text)}); Collect(ExpenseCollection, {LineItem: "", LineCost: 0, LineCount: 0, LineTotal: 0})

 

 

I did some extra testing and when i use the save button two times, the total is stored in the collection, doest that make sense? 

Collecting3.pngCollection2.png

Categories:
  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at
    Hi,
    What formula are you using to update your collection in which you want the multiplied value to be stored in the total field?
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at
    ForAll(ExpenseCollection, If(!IsBlank(LineItem), Patch(ExpenseDetails, Defaults(ExpenseDetails), {Titel: LineItem, ItemCost: LineCost, Count: LineCoun, Total: LineTotal, MasterID: Form1.LastSubmit.ID})));Navigate(Screen1)

    I use OnSuccess and all the fields are updated in SP except Total but i found that i need to push the save button twice to collect the multiple values but that doenst work very well for the business. All the others fields are working fine. 

  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at
    So you are using LineTotal to set the Total value. Where and how is the LineTotal variable getting set?
    And yes, I completely understand that clixk9kg it twice isnt an acceptable solution.
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    The default formula for LineTotal is LineCost*LineCount. I guess i need this to combine with LineTotal so that the information is stored directly?

     

    Collecting4.png

     

    I also tried to use the OnSelect or OnChange mode to select LineTotal but that doenst work very well. What do you advice for solution?

     

    ps: You see LineAantal, that is Dutch for LineCount 🙂

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Yes, found the solution! When i update my collection, i do the multiple here, o men, i really love PowerApps and the community here. 

     

    Patch(ExpenseCollection, ThisItem, {LineItem: inputItem.Text, LineCost: Value(inputCost.Text), LineCount: Value(inputCount.Text), LineTotal: Value(inputCount*inputCost.Text)}); Collect(ExpenseCollection, {LineItem: "", LineCost: 0, LineCount: 0, LineTotal: 0})
  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at
    You beat me to it!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 258

#3
Mohsin Ali Profile Picture

Mohsin Ali 231

Last 30 days Overall leaderboard