cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

What is the expression for Get files with compose

Hi all,

 

I have made a flow with a trigger "When a file is created or modified (properties only)". I made the following expressions which works fine: formatDateTime(triggerBody()?['Internal column name'],'yyyy-MM-dd')  

Now i used a new flow with the trigger recurrence combine Get files but my compose doenst work anymore.
I have tried al sorts of combinations but stiil it's doenst works, what is the expression when you use Get Files? This is 
formatDateTime(body('Get_files')?['Internal column name'],'yyyy-MM-dd')  wrong.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Dual Super User II
Dual Super User II

Re: What is the expression for Get files with compose

I suspect that your problem is the difference between a trigger that returns one file and Get files that returns a collection of files.  Since its a collection you need to access the properties of a particular file to have the same situation as you have in your triggered Flow. Try putting the result of the get files into a foreach loop and process your compose statements there or use First() around the output to selected the first file returned.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Highlighted
Anonymous
Not applicable

Re: What is the expression for Get files with compose

Yes, i fixed the problem, with apply to each. This is the solution:

 

Flow reminder.png

The condition is the column with a date to today start with the day. The scripts run fine

View solution in original post

6 REPLIES 6
Highlighted
Super User III
Super User III

Re: What is the expression for Get files with compose

@Anonymous, that formatDateTime at the end looks all wrong to me because you should have an Apply to each and then for each one you can format the date time. Could you post a screenshot of your flow so we can have a look.

Rob
Los Gallardos

Highlighted
Anonymous
Not applicable

Re: What is the expression for Get files with compose

Reminder.png

Here is the total flow

Highlighted
Dual Super User II
Dual Super User II

Re: What is the expression for Get files with compose

I suspect that your problem is the difference between a trigger that returns one file and Get files that returns a collection of files.  Since its a collection you need to access the properties of a particular file to have the same situation as you have in your triggered Flow. Try putting the result of the get files into a foreach loop and process your compose statements there or use First() around the output to selected the first file returned.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Highlighted
Dual Super User
Dual Super User

Re: What is the expression for Get files with compose

hI @Anonymous 

 

Get Files action will return a collection

You will have to run a for loop and only then can you fetch the individual columns in the collection

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Highlighted
Anonymous
Not applicable

Re: What is the expression for Get files with compose

Yes, i fixed the problem, with apply to each. This is the solution:

 

Flow reminder.png

The condition is the column with a date to today start with the day. The scripts run fine

View solution in original post

Highlighted
Anonymous
Not applicable

Re: What is the expression for Get files with compose

Do you have an example for this? For a new reminder i need to convert het calculated column to date column before the flow works.

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Users online (7,990)