Hello,
i need the Help from Community.
I have create a Flow for a Sharepoint list which should count the days between 2 dates.
Had here in the forum found a good example and this also readjusted.
It's the beginning of the flow. I have to finish it. Unfortunately I already got an error already. can someone tell me what i need to change
this is my Flow
formatDateTime(triggerBody()?['EventDate'],'o')
formatDateTime(triggerBody()?['EndDate'],'o')
addDays(variables('StartDate'),0,'MM/dd/yyyy')
addDays(variables('Enddate'),0,'MM/dd/yyyy')
addDays(variables('Enddate'),0,'MM/dd/yyyy')
@{outputs('Compose')}
@{outputs('Compose')}
Compose 3: addDays(variables('IndexDate'),1,'MM/dd/yyyy')
Set variable 2: @{outputs('Compose_3')}
Append to array variable: @{variables('IndexDate')}
when the flow has passed, he should count the days together and the result determines whether an approval is necessary or not. that will come later. First, I have to fight the mistake.
Solved! Go to Solution.
Hi @pit850 ,
You couldn't initial an Array variable with a date directly.
Please take a try to initial an Array variable with null, and then append the date to the Array variable to achieve your needs, the screenshot should as below:
The flow would run successfully as below:
Best regards,
Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
i have found the mistake.
Hi @pit850 ,
You couldn't initial an Array variable with a date directly.
Please take a try to initial an Array variable with null, and then append the date to the Array variable to achieve your needs, the screenshot should as below:
The flow would run successfully as below:
Best regards,
Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
First of all thanks for the help in the first step.
but now another problem has opened up. In my loop the days are to be counted which are present in the item.
so far so good. but if I check the content at the start of the loop is not the start date but it is increased by one value.
Thus, the loop test is not satisfied if it is only one day.
for Example:
i create a Item with Startdate 03/07/2019
Enddate 03/07/2019
the content in the loop is then the indexdate 03/08/2019. Thus the flow runs endlessly.
i have found the mistake.
User | Count |
---|---|
87 | |
37 | |
23 | |
20 | |
16 |
User | Count |
---|---|
127 | |
49 | |
46 | |
27 | |
25 |