I will go through the whole issue from its most granular level.
Following is my collection structure in PowerApps (displaying in table for easy to understand purpose): say colTable1 - >
Here the dates (25/01, 26/01,...) will keep on changing as and when new week is selected
25/01 26/01 27/01 28/01 29/01 30/01 31/01
| Project | Task | Description | Mon | Tue | Wed | Thu | Fri | Sat | Sun |
| Ford | Development | develop tyre | 3 | 4 | 0 | 0 | 0 | 0 | 0 |
| Ford | Design | design steering wheel | 2 | 0 | 0 | 0 | 0 | 0 | 0 |
| Hyundai | Testing | Test speed | 0 | 1 | 0 | 0 | 4 | 2 | 0 |
Now, I want to convert the above collection (table) to this: say colNewTable
| Project | Task | Description | Date | Hours |
| Ford | Development | develop tyre | 25-Jan | 3 |
| Ford | Design | design steering wheel | 25-Jan | 2 |
| Ford | Development | develop tyre | 26-Jan | 4 |
| Hyundai | Testing | Test speed | 26-Jan | 1 |
| Hyundai | Testing | Test speed | 29-Jan | 4 |
| Hyundai | Testing | Test speed | 30-Jan | 2 |
So basically the Date column (dynamic column, as it keeps on chaning based on week) is moved to multiple rows.
What I tried:
// For monday
Collect(
colPatchBack,
ForAll(
gallery.AllItems,
{
Project: //Project from dropdown,
Task: // Task from dropdown,
Description: // Description from input box,
Date: // Mon date,
Hours: Value(input_mon.Text)
})
)
)
// For tuesday
Collect(
colPatchBack,
ForAll(
gallery.AllItems,
{
Project: //Project from dropdown,
Task: // Task from dropdown,
Description: // Description from input box,
Date: // Tue date,
Hours: Value(input_tue.Text)
})
)
)
// For other week days
.....
What happens here is, it takes the Monday date and repeats value from first row and duplicates it for other rows.
Can I get some help here ?