cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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

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

Anonymous
Not applicable

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
RobElliott
Super User
Super User

@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

Anonymous
Not applicable

Reminder.png

Here is the total flow

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.

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

Anonymous
Not applicable

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

Anonymous
Not applicable

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
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (2,114)