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

Using manual trigger dates in condition

Hi

I am very new to flow and I'm trying to create a flow that requests for a [Start Date] and [End Date] when triggered.

Then I wish to use those dates in conditions so that I can populate a database with the document properties (from Sharepoint) where the document date is between the two dates.

 

I have been trying to use the following condition, but it isn't identifying any documents that fulfil the criteria even though I know there are some that do. 

 

@and(@greateror equals(items('Apply_to_each')?['Document_x0020_Date'], triggerbody()?['Start Date'], ''), @lessorequals(items('Apply_to_each')?['Document_x0020_Date'], triggerbody()?[End Date'], ''))

 

Any help with this would be very much apprecaited. 

 

TIA

2 REPLIES 2
Community Support
Community Support

Hi @Back2Basics,

 

What’s the trigger in your flow? How do you input Start date and End date when triggered?

To test this issue, I created a flow with the Button trigger, input Start date and End date using two text fields.

Then get file properties from a document library.

In the condition, input the following code:

@and(greaterorequals(items('Apply_to_each')?['Date'], triggerBody()['text']),lessorequals(items('Apply_to_each')?['Date'], triggerBody()['text_1']))

Note: triggerBody()['text'] is the Start date, triggerBody()['text_1'] is the End date.

The code works fine and documents within the two dates will be filtered out.

1.PNG

Please take it for a reference and try again on your side.

 

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.

Thanks Mabel Mao.

 

Yes, I have set up a button trigger  to get a user to input the start and end dates as you have done.

 

Thank you for the condtition code. I have used this and updated 'Date' to 'Document Date' as well as 'text' and 'text_1'. It works in terms of it being a workable condition, but I still get no returns, despite knowing that there are documents that fit this criteria. I thought it might be the date format that I'm using, but i've tried various formats and it's not working - do you know what format I should use for the 'start date' and 'end date' texts? 

 

I have tried: dd/mm/yyyy, mm/dd/yyyy, yyyy-mm-dd

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!

Users online (8,113)