cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MrNigel
Advocate V
Advocate V

How to pass just the filename from a manual flow trigger

We have a manually triggered flow with one input - Select a file.  All we want to do is pass the selected filename to the next action.  When running the flow from my PC, if I look at the Outputs the filename has populated the 'Select Employee spreadsheet name' field:

Trigger1.PNG

When I look at the available dynamic content for the next action I see 'Select Employee spreadsheet' but this is returning the spreadsheet binary content as per the contentBytes field.  

 

I then tried running the flow from my mobile and got a clue as to why this isn't working - it only allows me to select an image file, not a .xlsx:

Trigger2.jpg

Can anyone confirm that the File input option is expecting an image file only?  If that is the case what other way can I prompt a PC user to select a spreadsheet stored in OneDrive for Business and then use the filename in my next action?  I don't want to go down the PowerApps route unless there is no other option...... 😉

 

TIA Community!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Jcook
MVP

Hello,

Try adding a Compose action after the trigger.
And use this expression:

string(triggerBody()?['file']?['name'])

--Josh

If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others

Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





View solution in original post

4 REPLIES 4
Jcook
MVP

Hello,

Try adding a Compose action after the trigger.
And use this expression:

string(triggerBody()?['file']?['name'])

--Josh

If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others

Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





MrNigel
Advocate V
Advocate V

Hi Josh,

 

Your solution was spot on - many thanks - but it has revealed another issue.  I can now correctly define the path+filename of the spreadsheet but it is returning this error:

Trigger3.PNG

I am passing the string to the Excel 'List rows present in a table' action to return all the rows in a spreadsheet table.  You normally choose the spreadsheet file using the picker in the Action File field, so there must be a difference between that and inserting the same string without using the picker.

 

Hey ho, another Flow Funny 😉

 

Many thanks

 

Nigel

@MrNigel 

Unfortunately you can not use a dynamic filename for Excel connector.

 

Please consider voting for this feature here:

Excel Dynamic Filename

 

--Josh

 

If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others

 


Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





Voted.

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.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (4,324)