cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RaoulDobal
Level: Powered On

Adddays to add intervall to a sharepoint task list with variable days

I have a sharepoint task list that when a task is completed, creates a new element with a specific amount of days in the future. These days are defined by an intervall each task element has (yearly, monthly etc., defined in a dropdown list named 'intervaldescriptor')
I think having a multitude of if/then clauses is not really elegant, so I looked to "dynamically" use the add days function.
addDays(triggerBody()?['StartDate'],triggerBody()?['Interval'])
 
I tried two things:
  1. Interval: calculated column (if intervaldescriptor=Year, 365, if intervaldescriptor=Month etc. That did not work.
  2. so I tried the easy version of just adding the number of days in the field
    Interval: number field
But the workflow has problems with the ...triggerBody()?['Interval']. If I just put a number there, it works fine.
Any ideas how to achive this?
 
Thank you for your time
Raoul 
3 REPLIES 3
Community Support Team
Community Support Team

Re: Adddays to add intervall to a sharepoint task list with variable days

Hi @RaoulDobal,

 

Is the column Intervaldescriptor of type choice? What selections are contained in the dropdown?

It seems that each task has yearly, monthly etc. defined in the dropdown list, how is it configured?

I assume that without using calculated column, you could try to use if function to return the corresponding value based on the selection. Then use the return number in the adddays function.

Please share more details on your scenario for better understanding.

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
RaoulDobal
Level: Powered On

Re: Adddays to add intervall to a sharepoint task list with variable days

They are configured as a dropdown with (yearly, quarterly and monthly). From that I had a calculated field defined, giving me the days - if monthly>30.

 

I will have to look into the if function in flow - have not used this yet although it should have been obvious. Newbie to flow. I will post the results. 

RaoulDobal
Level: Powered On

Re: Adddays to add intervall to a sharepoint task list with variable days

Ok, a small step forward

 

I tried (among many other permutations)

if(equals(triggerBody()?['Intervall'],'Jahr'),'365','1')

 

The flow runs through, but it always gives me false (feedback 1)

 

The goal is - If it would find the Sting 'Jahr" in the dropdown generated sharepoint list field [Intervall], it would output 365, otherwise it would output 1. Of course I would then replace 1 with another IF statement for "months" and so forth.

 

But it doesn't

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 348 members 5,141 guests
Please welcome our newest community members: