web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Automate
Unanswered

Object variable issue

(0) ShareShare
ReportReport
Posted on by 3
I have a flow. In that flow, there is a case statement based on Document type.
Flow 1.png
 
After this case statement there will be an object populated with some metadata. I want to store this object against a variable. So that i can create the object later in the flow, no matter what case was selected.
 

I have two issues:

  1. To set an object variable, i can't use the Word Template object, because it may be one of two.

Flow 2.png

 

My question on this is, how would I populate the variable with the correct object that was just populated in the Statement?

 

  1. When i try to create a document using the variable with the object, i can't open the document. Can you create an object using an object that is stored in a variable?

Flow 3.png

After i create a document using the object stored in the variable, this is what I get. I can only assume that the create file method doesn't like using object variables?

word error.png

 

Thanks for any help, i'm pretty new to flows, as you can probably tell!

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    Hi @Mick92,


    I would use two set object variable actions. One in every case. This way you don't have to figure out in which case it was. Hope that makes sense?

  • Mick92 Profile Picture
    3 on at

    Hi @Expiscornovus That does make sense, thankyou. 

     

    Have you ever seen the other issue? Where using the variable  as the file content results in an error?

     

    Regards,

    Michael

  • Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    Hi @Mick92,

     

    Yes, I have seen that other issue way too often 😂

     

    I believe you can store it as string instead of an object and use the base64 and base64tobinary functions to convert it into reusable valid filecontent.

     

    Have a look at this article by @Jay-Encodian who explains it a lot bettter than me 😁:

    https://www.encodian.com/blog/how-to-add-a-file-to-a-power-automate-variable/

     

    base64_filecontents.png

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard