Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Power Automate Flow - Use variable as File Name in 'Get File Content' action 'File Identifier Field'

Like (0) ShareShare
ReportReport
Posted on 8 Jan 2022 02:09:52 by 45

So my flow works wonderfully, until I attempt to use a variable name in the 'Get File Content' action 'File Identifier Field'. I need to do this to load a different template depending on the value returned from a condition block. I was so confident that this would work because the logic makes perfect sense. But it failed miserably and I have spent hours researching and trying to fix it but to no avail and it is out of desperation that I decided to give this platform a try. Can someone please help me? Any help at all would be greatly appreciated.

 

I have included attached a picture in reference to the block that I need to work, after which everything else will be fine.

 

Also, I am new here but I did my best in creating this first question.Snap 2022-01-07 at 20.58.01.png

  • Verified answer
    Strikerme Profile Picture
    45 on 08 Jan 2022 at 14:35:54
    Re: Power Automate Flow - Use variable as File Name in 'Get File Content' action 'File Identifier Field'

    Hi @WarrenBelz,

    Thank you so much for your very insightful response once more. You are indeed correct and because of your advice I abandoned that approach. Instead I figured out an alternative solution yesterday that works by just storing the variable value in the 'Item Id' value instead because that one can be dynamic without any problems.

     

    I was so focused on reducing repetitive actions that I did not really look at this solution that was staring me right in the face. It is just one extra action in the condition block and so it is not that bad and it works wonderfully.

     

    I have explained my work around here on the Power Automate Community: https://powerusers.microsoft.com/t5/Building-Flows/Power-Automate-Flow-Use-variable-as-File-Name-in-Get-File/m-p/1409773

  • WarrenBelz Profile Picture
    146,780 Most Valuable Professional on 08 Jan 2022 at 07:18:59
    Re: Power Automate Flow - Use variable as File Name in 'Get File Content' action 'File Identifier Field'

    Hi @Strikerme ,

    I have now put brain fully in gear - you cannot possibly define the merge target dynamically as the next element displays all the merge fields in the form so you can put values in them. You cannot open this element without the Flow knowing the merge document it has to deal with.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • Strikerme Profile Picture
    45 on 08 Jan 2022 at 04:17:08
    Re: Power Automate Flow - Use variable as File Name in 'Get File Content' action 'File Identifier Field'

    @WarrenBelz Thank you so much for pointing me in the right direction. I will create the post over in the power automate community.

     

    By the way you've helped me out not only on here but on other blog articles on your site (https://www.practicalpowerapps.com) as well. It is folks like yourself who makes learning a more pleasant experience.

    So thanks a mill.

  • WarrenBelz Profile Picture
    146,780 Most Valuable Professional on 08 Jan 2022 at 03:53:06
    Re: Power Automate Flow - Use variable as File Name in 'Get File Content' action 'File Identifier Field'

    Hi @Strikerme ,

    I have a couple of large flows with conditional branches (it seems up to 10 work fine) based on the form needed to be generated (which I send as a parameter). I do as much as possible "at the top" before branching and then generate the documents which I PDF, store in SharePoint and on some email to various people.

    Nice to meet you as well - I am just and old guy from Australia sharing a lot things I have learnt from making mistakes . . . also I am not a Flow guru (far from it), so you might want to post this on the Power Automate Community.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • Strikerme Profile Picture
    45 on 08 Jan 2022 at 03:45:45
    Re: Power Automate Flow - Use variable as File Name in 'Get File Content' action 'File Identifier Field'

    Thank you so much for your response. It is a pleasure to meet you by the way @WarrenBelz You don't know how many answers of yours have actually helped me out when I was in dire situations. I can't believe I'm actually talking to you. I feel starstruck.

     

    For your scenario what work around did you use? I was thinking of just putting everything in the conditional blocks but that would be overkill because there is just too many actions and it seems very impractical.

    Please let me know the alternative viable options.

  • WarrenBelz Profile Picture
    146,780 Most Valuable Professional on 08 Jan 2022 at 03:37:47
    Re: Power Automate Flow - Use variable as File Name in 'Get File Content' action 'File Identifier Field'

    Hi @Strikerme ,

    I have actually tried that one as I have a heap of standard forms merged off Word Templates. What I believe is happening in the background is that the Flow is getting the identifier of the file to retrieve it, so (like a lot of other elements in Power Platform), you cannot refer to it dynamically.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,780 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,093 Most Valuable Professional

Leaderboard
Loading started