cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Andries
Frequent Visitor

Using drop down selections to create a table

Good Day 

 

I have created 4 drop down lists connected to a Database. 

 

The purpose of this is to have users select the starting day of the month 'DropdownDays' and the month itself 'DropdownMonths'. I have done the same with the end of the month 'DropdownDays_end' and 'DropdownMonth_end'. I want to use those submissions to generate a interactive table or such showing all the dates from the 'DropdownDays' & 'DropdownMonths' to the end. The purpose is for the user then to select if he was present that day or on aunual leave such. 

 

The purpose of this is for time and attendance between the 21th and the 20th of the next month. 

 

I am not sure if it will be better to just ask the user to select days that he was off from a calender and then assign the type of leave to the selections. 

 

Open to suggestions 

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @Andries,

 

Could you please share a bit more about your scenario?

Could you please show more details about your data source?

Further, do you want to display all dates between two different dates?

 

If you want to display all dates between two differen dates, please take a try with the following workaround:3.JPG

 

Set the OnVisible property of the first screen of my app to following formula:

ClearCollect(DaysCollection,["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31"])

 

 

Set the Items property of the DropdownMonths  Dropdown control and DropdownMonth_end Dropdown control to following formula:

 

["01","02","03","04","05","06","07","08","09","10","11","12"]

Set the Items property of the DropdownDays Dropdown control and DropdownDays_end Dropdown control to following formula:

["01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31"]

Set the OnSelect property of the "Retrieve" button to following formula:

Clear(RetrievedDates);
ForAll(
FirstN(DaysCollection,DateDiff(Date(Value(Text(Today(),"[$-en-US]yyyy")),Value(DropdownMonths.Selected.Value),Value(DropdownDays.Selected.Value)),Date(Value(Text(Today(),"[$-en-US]yyyy")),Value(DropdownMonth_end.Selected.Value),Value(DropdownDays_end.Selected.Value)))+1),
Collect(
RetrievedDates,
DateAdd(Date(Value(Text(Today(),"[$-en-US]yyyy")),Value(DropdownMonths.Selected.Value),Value(DropdownDays.Selected.Value)),Value(Value))
)
)

Set the Items property of the Data table control to following formula:

RetrievedDates

The GIF image as below:Test1.gif

 

 

 

 

Best regards,

Kris

 

 

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-xida-msft
Community Support
Community Support

Hi @Andries,

 

Could you please share a bit more about your scenario?

Could you please show more details about your data source?

Further, do you want to display all dates between two different dates?

 

If you want to display all dates between two differen dates, please take a try with the following workaround:3.JPG

 

Set the OnVisible property of the first screen of my app to following formula:

ClearCollect(DaysCollection,["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31"])

 

 

Set the Items property of the DropdownMonths  Dropdown control and DropdownMonth_end Dropdown control to following formula:

 

["01","02","03","04","05","06","07","08","09","10","11","12"]

Set the Items property of the DropdownDays Dropdown control and DropdownDays_end Dropdown control to following formula:

["01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31"]

Set the OnSelect property of the "Retrieve" button to following formula:

Clear(RetrievedDates);
ForAll(
FirstN(DaysCollection,DateDiff(Date(Value(Text(Today(),"[$-en-US]yyyy")),Value(DropdownMonths.Selected.Value),Value(DropdownDays.Selected.Value)),Date(Value(Text(Today(),"[$-en-US]yyyy")),Value(DropdownMonth_end.Selected.Value),Value(DropdownDays_end.Selected.Value)))+1),
Collect(
RetrievedDates,
DateAdd(Date(Value(Text(Today(),"[$-en-US]yyyy")),Value(DropdownMonths.Selected.Value),Value(DropdownDays.Selected.Value)),Value(Value))
)
)

Set the Items property of the Data table control to following formula:

RetrievedDates

The GIF image as below:Test1.gif

 

 

 

 

Best regards,

Kris

 

 

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,020)