Hi @Prem_ddsl,
Do you have any other questions about PowerApps?
Thanks for your sharing, I would share your solution to my colleagues.
If you have any other questions, please reply here, I would provide a proper workaround for you.
Best regards,
Kris
Hi, I need to repeat TWO actions for all the rows of a table.
It is no possible to do it with FORALL function, so I don't know what to use for it....
I can do it by pressing a button manually as many times as ROWS but I want to do it for all the rows with only one press button.
This Calculate de RUNNING TOTAL for EACH ROW
For example:
UpdateContext({auxSaldoEfectivo:DateAdd(auxSaldoEfectivo;1)});; UpdateIf(Presu;DateValue(FechaPresu)=(auxSaldoEfectivo); {SaldoE: Sum(Filter(Presu;DateValue(FechaPresu)<=(auxSaldoEfectivo));ResultadoE)})
Hi. I agree that FORALL cannot do a running total because it's updating the entire set as in sql rather than iterating through each row as in a proper loop.
Since running total is dependent on the last row's value, I think you need to update your running total in the same block of code which is patching the new row. So you end up with:
1. fetch last row
2. calculate running total for new row
3. patch new row
Hope that idea makes helps.
Prem
GREAT help...I solved that with: forall...patch....lookup...sum...filter
Many Thanks Prem_ddsl
@Prem_ddsl this is awesome, thank you!
I've adjusted it to take dynamic values of vMaxRows and have RowId start from a dynamically set value and it works a treated. I'm using it to collect missing records from a Sharepoint List data grab and matching RowId values to the SP ID values.
Cheers again!
🙂
How I get the current item in a forall loop
I think you should be able to simply reference the field names of your collection directly in the. Perhaps I'm not understanding your situation. Here's a snippit from the ForAll documentation: "Fields of the record currently being processed are available within the formula. You simply reference them by name as you would any other value. You can also reference control properties and other values from throughout your app. "
1. If else
2. Loop
3. A simple loop is way more complex so what is gained here
4. JavaScrpt is Native to the browser and it can loop
5. why remove or reduce what is available
6. why obfuscate it
7. Productivity, seriously folks its non productive
8. Problem with statment based code is as soon as it becomes moderately complex it becomes extremely dificult to debug
9. There is very good debugging in JavaScript
10. I have seen time and time again largish things built in these types of interfaces they are less maintainable and some times requires woo's or 1000's of lines of statment based code where a simple loop would have reduced the complexity greatly
11. Have a good hard think
1. If else
2. Loop
3. A simple loop is way more complex so what is gained here
4. JavaScrpt is Native to the browser and it can loop
5. Why remove or reduce what is available
6. Why obfuscate it
7. Productivity, seriously folks its non productive
8. Problem with statement based code is as soon as it becomes moderately complex it becomes extremely dificult to debug, because its just a very long errant string
9. There is very good debugging in JavaScript
10. I have seen time and time again largish things built in these types of interfaces they are less maintainable and some times require 100's or 1000's of lines of statement based code where a simple loop would have reduced the complexity greatly
11. Have a good hard think
User | Count |
---|---|
124 | |
87 | |
86 | |
75 | |
69 |
User | Count |
---|---|
214 | |
181 | |
140 | |
96 | |
83 |