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

Date range from form and and a row into a table per date

Sorry if this is a basic question and I should already know this. I am extremely new to Power Automate/MS Flow. In fact, this is the first one I have ever made. 

 

I am working on a basic attendance tracker for a smaller company that allows employees who are going to be late or who are calling out for the day to fill out a form to report this to save a lot of the work for the management staff for tracking. I have most of this working but I am unsure how to take the date range from form(I have a Start date and a Return date field) and get this to create a row into a table per each date. By each date I mean Both dates provided and every date in between. 

 

Let me know of any information needed about my current flow and I would be happy to provide it. 


I have not tested it but I think I have it set up correctly for a single date if I just run off the Start date. 
------------------------------------
UPDATE AND CLARITY
I do wish to say thank you to those looking into this for me as this is my first time doing anything like this. 
I have the below screenshots showing what I have built so far. I have blacked out the name of the client the company is supporting for their privacy. 

So I built a form using MS forms that collects the information for the employee calling out. 
This information then goes through an approval process.  I did get the approval process working
Depending on if this is approved it will either email the person who placed the request letting them know if it is rejected or approved. 

No other action is taken if it is rejected as at that point they will need to speak with the reviewer to find out why. 
On the approved side, the company tracks the employees who took the day off using two different methods, we have a calendar that has to be updated as well as an excel tracker that gets updated. 
*I have the Calendar update working with no issues. 
*I do not have the excel tracker update working. (This is what I need help with)
I know I need to use the "Add a row to a table function to get the info into the tracker but I am unsure how to get the add row to a table function to do this for each date the person is saying they will not be at work. 

I have provided screenshots below with labels.

The flow as I have created it so far:
The flow as I have it built so farThe flow as I have it built so far

The form where I collect the name of the person calling out:How we collect the nameHow we collect the name

The section of the form where they provide when they will be off work.

How the employee provides they Days they are going to be off workHow the employee provides they Days they are going to be off work

The section of the form where the employee says why they will not be at work:
How the employee says why they are not at workHow the employee says why they are not at work

Excel Table in the tracker that needs to have the Employee's name, the reason for out, and the day they were out added. I'm sure I could get this to work for a single date if I tried but I currently have not idea how to get it to add more then one entry into this for each day they are out.  ignore the points section as that is how we track if someone has had too many unplans. This is handled in the excel doc and I am hoping just adding a new row won't affect that part. 
Excel Table in the tracker.PNG

 

4 REPLIES 4
Solution Specialist
Solution Specialist

Are you using SharePoint List OR Microsoft form? Can you please upload your flow picture and explain where your are facing issue?

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community
Responsive Resident
Responsive Resident

Hi,

Your question's a bit unclear but strictly focusing on this portion of it..."take the date range from form(I have a Start date and a Return date field) and get this to create a row into a table per each date. By each date I mean Both dates provided and every date inbetween."

 

Let's take the following example:

  • Employee: Bugs Bunny
  • Start date: 9/25/2020
  • Return date:  9/30/2020

Are you looking to dynamically do something like this?

 

PA_UG_Datechallenge1.png

 

I have updated the original post I hope this helps make things clear as to what I am trying to achieve. 

Maybe I can offer a little different perspective on the question.

Using Microsoft Forms, we created a form that, among other fields, requests a Start Date and an End Date.

 

In MS Flow while attempting to process the form, we need to repeat an action for every date in the range. We tried creating an array and using a Do Until to populate the array with each date in the range, but that isn't working for us either - we get output, but it always shows up in our output Excel doc as

["2020-11-28T00:00:00.0000000"]

and not as any format Excel can translate to a date.

 

If we just pull the Start Date in, we can save that correctly.

This works.PNG

Test2.PNG

How can we repeat that process, adding to the date one day at a time, until we hit End Date?

 

We considered using Start Date and Number of Days instead of End Date. This nicely controls the number of times we iterate through the action but doesn't help us in terms of formatting the output date which, of course, has to grow by one day for each iteration.

When we attempted to use an array it produced odd results and only provided one entry with one, incorrect and incorrectly formatted, date.
Here is the weird result we got from our attempts at an array. (Array we built not photoed as it did not work)

Test1.PNG

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (9,473)