Forum Discussion
Create document custom content type WITHOUT opening Word
This post talks about how someone has done it with that connector. https://powerusers.microsoft.com/t5/Microsoft-Flow-Community-Blog/Create-DOCX-Word-document-from-template-based-on-dynamic-data-in/ba-p/79389
Thanks, I tried the "list where you specify the document properties and then use Flow to create the document" and there are some items that Flow won't recognize. The two big problems are:
1. I have a select value column based on another list - that doesn't move. So I have to create a NEW column (since you cannot edit a select column into something different, which is great fun since it means every document type will have to get updated).
2. The BIGGER problem is creating the document type. So I have, for example Tree Contract, Grass Contract, Dead Body Contract as 3x content types. I cannot, in a list, find a way to select the document type. I thought I could just have a selection and then an if statement, but I cannot figure out how to make that work as the If <selectcontenttypeColumn> contains <Dead Body>, then create file with that content type.
If I could get past problem 2 it can be done with existing sharepoint/flow.
- Alan MarshallAug 16, 2018Iron Contributor
Try using the copy file action in Flow of a document that is the correct content type, it should then create a new file that has the content type already associated. In this model, you would have a list where the properties are specified and the document type, a library with templates associated with the correct content type and a library where the files are created. When a user adds a new item to the list, copy the file for the associated content type and then update its properties with the list fields, last step will be to use the Plumbsail connector to update the Word controls.
- Jonathan BanerAug 16, 2018Copper ContributorI genuinely appreciate the help! The problem is the "create a new file that has the content type already associated...copy the file for the associated content type." I cannot get the user to associate the correct content type. If there were really only 3 content types I could just have three lists that required user to go into designated list to add item which would then populate out.
MAYBE I can create a list content type and then if statement it out from there. So new list item is new>DeadBodyList and then under Flow throw if Dead Body from list item then the content type added will be DeadBodyContent.- Jonathan BanerAug 16, 2018Copper Contributor
OK. Fine. I'll admit it has been a over a decade since I did anything resembling coding. Variables. One can always blame variables for problems.
To solve this issue I was having I ended up creating content types at the list level, but the solution works other ways as well. This way I get to speed things up a little bit due to my unique needs.
Variable. I wanted to use If statements to turn a user selected content type into a later jammed in content type. So user selects "Dead Body Cleanup" form or whatever from dropdown selection. Right off the bat I create a string variable with value = content type selected from dropdown by user. Then the if <Variable> startsWith <Dead>, then create document using that content type.
ALSO - I realize this is not elegant.