
Announcements
Hello, All,
I'm new to power apps, I'm trying few things, stuck in below issue and require some help.
I have a table1 as below, my requirement is to delete one of these rows and update the order columns with proper numbering.
For example if I delete second row below, I would like to update the order column in rows 3,4 and 5 with 2, 3, and 4 respectively.
| Fruits | Shops | Order |
| Apple | Shop1 | 1 |
| Orange | Shop2 | 2 |
| Grapes | Shop3 | 3 |
| Banana | Shop4 | 4 |
| Mango | Shop5 | 5 |
Expected
| Fruits | Shops | Order |
| Apple | Shop1 | 1 |
| Grapes | Shop3 | 2 |
| Banana | Shop4 | 3 |
| Mango | Shop5 | 4 |
Hi @vinnav, in your example you can use "ForAll" and "Patch" functions, you must update the items with Order > 2 and subtract 1:
RemoveIf(
colFruits,
Order = 2
);
ForAll(
Filter(
colFruits,
Order > 2
),
Patch(
colFruits,
ThisRecord,
{Order: ThisRecord.Order - 1}
)
)