cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Wackmack88
Level 8

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

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

Wackmack88
Level 8

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

Re: What is the expression for Get files with compose

@Wackmack88, 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

Wackmack88
Level 8

Re: What is the expression for Get files with compose

Reminder.png

Here is the total flow

Dual Super User
Dual Super User

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

Dual Super User
Dual Super User

Re: What is the expression for Get files with compose

hI @Wackmack88 

 

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

Wackmack88
Level 8

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
Wackmack88
Level 8

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

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!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

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 Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (4,315)