Forum Discussion
Fabrice Frachon
Jun 28, 2019Microsoft
I would like to pass to Sharepoint>Create file, a variable of type Object to the File Content param
In my flow, depending various conditions I am using distinct templates to create a word document, using "Populate a Microsoft Word template".
For each case, I store the created file in a variable...
Damien_Rosario
Silver Contributor
OK maybe try using Compose and using the Set initialize variable output as the source. Then use the compose box output as the file content.
SJHBham
Oct 31, 2022Copper Contributor
Fabrice Frachon, Damien_Rosario is correct. It should look like this:
- Initialize variable of type object
- Use a Switch control to run the right Populate a Microsoft Word Template action
- Set the variable of type object to the output of the Populate a Microsoft Word Template in each switch case
- After the switch control, add a Compose action with the input of your variable of type object
- Use the Create File SharePoint action and add the output of the Compose action as the File Content.
If you don't add the Compose action in step 4, the file will become corrupt when the Create File in SharePoint action is completed.