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 Platform Community / Forums / Power Automate / Create an Instance of ...
Power Automate
Unanswered

Create an Instance of an SPO Content Type Using the "Create File" Flow Action

(0) ShareShare
ReportReport
Posted on by 33

This is what I need to do: create a new instance of a SharePoint Online Content Type in a targeted Document Library using the SharePoint "Create file" action.

 

I am hitting a wall at the "File Content" parameter.

 

What does one enter in File Content if it doesn't yet exists? How does one create the File Content explicitly using a specific SharePoint Content Type in order to pass this object to the "File Content" parameter?

 

Capture.PNG

Categories:
I have the same question (0)
  • Rahber Profile Picture
    1,935 on at

    What type of file you are trying to create? Excel Word PDF?

    TO know the content value of an empty file. First manually create a Empty File in your library and then use the Get File Content action and then use the value from Get File Content into your new Create File ACtion

     

    Please click Accept as Solution if it resolved your problem or give it a Thumbs Up if it helped you in anyway this will allow other people to search correct solutions effectively.

    Thanks,

    Rahber

  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @grhsVman 

     

    This is by design. I you don't have a file content then you won't be able to create this flow action. Generally this is used for getting a file as an attachment from an email or other data sources for transferring one place to another. May I ask you why you trying to create file when you don't have a content ready?

     

    Thanks

  • v-litu-msft Profile Picture
    on at

    Hi @grhsVman,

     

    I assume that you want to put some content extract from somewhere into the create File content field but sometimes the content is empty, right? If so, you should judge the file content whether is empty, or the create file will report error if there is nothing in file content.

    You could use the condition to determine the content whether is empty. If it isn't empty, create file. If it is empty, do nothing.

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • grhsVman Profile Picture
    33 on at

    The replies are much appreciated. I fear, however, I was clumsy in describing what I am trying to do. I will clarify.

     

    Yes, I know that no content exists when the flow is triggered and that content is required to use the "Create new file" action. That is what I want to do in the flow, create the content in a previous action and pass it to the Create new file action.

     

    But I don't want to just create "any" content. It is very specific. I want to create a new file that is an instance of a specific SharePoint Content Type that has a default template so that when a file is created based on that content type, it will, right out of the gate, have content.

     

    Here is background on the SharePoint setup:

     

    1) A SharePoint Site Content Type exists called demoCustomType:

     

    Capture.PNG

     

    2) That Site Content Type has a default "template" that is an Excel file. That file is already full of tabs and formulas and other content.:

    Capture.PNG

     

     

    3) The Site Content Type is available in a document library of a SharePoint site so that when a user selects New->demoCustomType, a NEW Excel document will be created that is effectively a "copy" of the "default template" for the demoCustomType Site Content Type:

    Capture.PNG

     

     

    Untitled.png

     

    ************************************************

     

    When a user selects New->demoCustomType, he or she will get a new file that already has the content of the default template associated with the Site Content Type.

     

    I want to do exactly this in a Flow (create content based on a specific Site Content Type and its default template).

  • grhsVman Profile Picture
    33 on at
  • grhsVman Profile Picture
    33 on at
  • grhsVman Profile Picture
    33 on at

    ...

  • khumphries1 Profile Picture
    65 on at

    So, @grhsVmanI gather there have been no solutions to this? I have the same issue.

  • grhsVman Profile Picture
    33 on at

    It was working, then about two weeks ago, it started behaving this way.

  • khumphries1 Profile Picture
    65 on at

    @grhsVman-- What, exactly was working? I can't seem to pick out a solution from the ideas offered in this thread. Your 2nd attempt at a description of your problem seems exactly like what I am trying to accomplish.

     

    I am feverishly upgrading SPD 2010 workflows due to the EOL issued by Microsoft. The original 2010 workflow is quite simple:

    khumphries1_0-1598375369795.png

    If a value condition in a list is satisfied, create a file in a target library of a certain Content Type. Here are the Content Types in the target Library Settings:

    khumphries1_1-1598375508827.png

    I recreated this in SPD2013 using the same Create Item action and the same Content Type:

    khumphries1_2-1598375682078.png

    but this only creates a blank document in the target Library (possibly? based on the original 'Document' Content Type).

     

    So, I tried to create a Power Automate flow (this example omits the conditional check):

    khumphries1_4-1598376755933.png

    but there is no place to enter a Content Type ID.

     

    I see in this thread a notion of inserting a 'Get file content' or 'Get file content using path' action to collect details about template documents in the library. For example:

    khumphries1_5-1598377067399.png

     

    I can see the Library, but enumerating the files fails, possibly because there are more than 5000 documents in the library (although there are no views that exceed the 5000 doc limit).

     

    Any ideas for me? Is the 'Get file content' idea the one that was working until 2 weeks ago?

     

     

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard