Hello,
I am working on a timesheet component (compTimesheet) and I am facing multiple issues. My plan is to connect the component to Dataverse solution(s). Component contains 3 custom table input properties - Actuals, Assignments, ShownPeriod.
Actuals
Table(
{Date: "4/29/2024", Mail: "user@mail.com", Project: "Project1", Task: "Task1", Hours: 2},
{Date: "4/30/2024", Mail: "user@mail.com", Project: "Project2", Task: "Task3", Hours: 4}
)
Assignments
Table(
{Mail: "user@mail.com", Project: "Project1", Task: "Task1"},
{Mail: "user@mail.com", Project: "Project1", Task: "Task2"},
{Mail: "user@mail.com", Project: "Project2", Task: "Task3"}
)
ShownPeriod
DateAdd(DateAdd(Today(),1-Weekday(Today(),StartOfWeek.Monday),TimeUnit.Days),Sequence(7,0,1),TimeUnit.Days)
Component contains 3 galleries - galPeriod, galAssignment, galHours.
galHours is nested in galAssignment.
Items property in galHours loops through all the days in galPeriod and then maps the hours from Actuals to specific project / task.
ForAll(
galPeriod.AllItems As _periodDays,
ForAll(
Filter(
compTimesheet.Actuals,
ThisItem.Task in Task && ThisItem.Project in Project
),
If(
_periodDays.Value in Date,
{
Hours: Hours,
Date: _periodDays.Value
},
Blank()
)
)
)
Not quite sure if this is the best approach but that is the best I could do in order to make the blank fields visible.
I am struggling with the part when user makes some changes to the galHours and clicks on Submit button. As per my understanding, it is not possible to use collections. How should I get the updates from user? I have tried creating Output variable "SubmittedChanges" and fed it, but no success (below is an example which did not work for me).
Table(
ForAll(galWeek.AllItems As _PeriodDays,
ForAll(
galAssignment.AllItems As _Assignments,
ForAll(
galHours.AllItems As _Hours,
{Hours: Value(_Hours.txtHoursInput.Value),
Project: _Assignments.lblProject.Text,
Task: _Assignments.lblProject.Text,
Date: _PeriodDays.Value}
)
)
)
)

Report
All responses (
Answers (