All,
I am building a timesheet App using a gallery and collection.
I would like the App to start with 5 PreSaved rows which will all be blank besides the Project field. I need to fill in:
Paid sick, Unpaid sick, Comp Time, Holiday, and Vacation (picture below)
Any suggestions how to achieve this? Thanks
Solved! Go to Solution.
Hi @aishak12 :
Please try:
1\Set the APP's OnStart property to:
Collect(
collectionTest,
{
EmployeeName: "",
Project: "Paid Sick",
Phase: "",
Task: "",
Comment: "",
Total: "",
Saturday: "",
Sunday: "",
Monday: "",
Tuesday: "",
Wednesday: "",
Thursday: "",
Friday: "",
Date: Now(),
LaborCode: "",
rowNumber: 1,
Company: ""}
);
ClearCollect(
collectionTest,
{Project: "Paid Sick"},
{Project: "Unpaid Sick"},
{Project: "Comp Time"},
{Project: "Holiday"},
{Project: "Vacation"}
)
2\Add a button into the gallery and set it's OnSelect property to:
Patch(
collectionTest,
Thisitem,
{
EmployeeName: Office365Users.MyProfile().DisplayName,
Project: ProjectBox_8.Selected.Column2,
Phase: Left(PhaseBox_6.Selected.Phase,3),
Task: Left(TaskBox_6.Selected.Result,5),
Comment: CommentInput4_4.Text,
Total: TotalText_8.Text,
Saturday: SatInput_8.Text,
Sunday: SunInput_8.Text,
Monday: MonInput_8.Text,
Tuesday: TueInput_8.Text,
Wednesday: WedInput_8.Text,
Thursday: ThuInput_8.Text,
Friday: WedInput_8.Text,
Date: DatePicker1_18.SelectedDate,
LaborCode: Left(LaborBox_6.Selected.LaborCode,3),
rowNumber: CountRows(collectionTest),
Company: LookUp(Table1, EmployeeEmail = User().Email, Company)
}
)
Best Regards,
Bof
Yes I am assuming the gallery is using a collection in the items property.
So i would usually ClearCollect the 5 blank rows apart from project name onvisible of the page and reference the project name as the default for that input. If you need more specific help please provide the items property of the gallery. the items of the project name input in the gallery, the relevant column names in the collection. and the default/defaulteselecteditem of the project name input.
Signature:
If you appreciated my comments/responses please be sure to Like/Kudo them it really does make me smile 🙂 !
Link to the Power Platform Professionals United Kingdom User Group:
Yes I am using a collection in the items property.
items property of the gallery:
collectionTest
The items of the project name input is a Combo box named ProjectBox_8 with items property:
Projects
DefaultSelecteditem is blank for project input
This is my current submit button:
Set(Gal_DM, DisplayMode.Disabled);
Collect(
collectionTest,
Table(
{
EmployeeName: Office365Users.MyProfile().DisplayName,
Project: ProjectBox_8.Selected.Column2,
Phase: Left(PhaseBox_6.Selected.Phase,3),
Task: Left(TaskBox_6.Selected.Result,5),
Comment: CommentInput4_4.Text,
Total: TotalText_8.Text,
Saturday: SatInput_8.Text,
Sunday: SunInput_8.Text,
Monday: MonInput_8.Text,
Tuesday: TueInput_8.Text,
Wednesday: WedInput_8.Text,
Thursday: ThuInput_8.Text,
Friday: WedInput_8.Text,
Date: DatePicker1_18.SelectedDate,
LaborCode: Left(LaborBox_6.Selected.LaborCode,3),
rowNumber: CountRows(collectionTest),
Company: LookUp(Table1, EmployeeEmail = User().Email, Company)
}
)
);
Set(Exp_DM, DisplayMode.Edit);
And my current Clear button code:
Clear(collectionTest); Set(varComment,0); Clear(colComment); Clear(colWeek);
Thank you for your help!
Hi @aishak12 :
Please try:
1\Set the APP's OnStart property to:
Collect(
collectionTest,
{
EmployeeName: "",
Project: "Paid Sick",
Phase: "",
Task: "",
Comment: "",
Total: "",
Saturday: "",
Sunday: "",
Monday: "",
Tuesday: "",
Wednesday: "",
Thursday: "",
Friday: "",
Date: Now(),
LaborCode: "",
rowNumber: 1,
Company: ""}
);
ClearCollect(
collectionTest,
{Project: "Paid Sick"},
{Project: "Unpaid Sick"},
{Project: "Comp Time"},
{Project: "Holiday"},
{Project: "Vacation"}
)
2\Add a button into the gallery and set it's OnSelect property to:
Patch(
collectionTest,
Thisitem,
{
EmployeeName: Office365Users.MyProfile().DisplayName,
Project: ProjectBox_8.Selected.Column2,
Phase: Left(PhaseBox_6.Selected.Phase,3),
Task: Left(TaskBox_6.Selected.Result,5),
Comment: CommentInput4_4.Text,
Total: TotalText_8.Text,
Saturday: SatInput_8.Text,
Sunday: SunInput_8.Text,
Monday: MonInput_8.Text,
Tuesday: TueInput_8.Text,
Wednesday: WedInput_8.Text,
Thursday: ThuInput_8.Text,
Friday: WedInput_8.Text,
Date: DatePicker1_18.SelectedDate,
LaborCode: Left(LaborBox_6.Selected.LaborCode,3),
rowNumber: CountRows(collectionTest),
Company: LookUp(Table1, EmployeeEmail = User().Email, Company)
}
)
Best Regards,
Bof
User | Count |
---|---|
121 | |
87 | |
87 | |
75 | |
66 |
User | Count |
---|---|
215 | |
180 | |
138 | |
96 | |
82 |