Hi
I have a collection as follows:
Name | Quantity |
Ed | 8 |
Tom | 3 |
Alan | 1 |
I need to update these records based on new records in a specified order:
Name | Quantity |
Ed | -3 |
John | 13 |
So my final collection will be:
Name | Quantity |
Ed | 5 |
Tom | 3 |
Alan | 1 |
John | 13 |
I'm looping through each new row in order using a ForAll. I don't know how to update the Quantity based on the existing Quantity, something like:
Patch(
Rows,
LookUp(
Rows,
Rows[@Name]=NewRow[@Name]
),
{
Quantity=Quantity+NewRow[@Quantity]
}
)
Any help would be appreciated. Thanks.
Solved! Go to Solution.
@edhalsim Absolutely simple!
Just have to see it from inside out.
Please remember to give a 👍 and accept my solution as it will help others in the future.
Please try the following (replace collection names as applicable),
ClearCollect(colCombined, DropColumns(AddColumns(GroupBy(Collect(col1, col2), "Name", "GroupedData"), "Quantity", Sum(GroupedData, Quantity)), "GroupedData"));
Please remember to give a 👍 and accept my solution as it will help others in the future.
Wow. This is beyond my current level of understanding. Would you please explain what you're doing?
@edhalsim Absolutely simple!
Just have to see it from inside out.
Please remember to give a 👍 and accept my solution as it will help others in the future.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
195 | |
69 | |
49 | |
47 | |
19 |
User | Count |
---|---|
250 | |
127 | |
84 | |
75 | |
74 |