I would like to pass to Sharepoint>Create file, a variable of type Object to the File Content param

%3CLINGO-SUB%20id%3D%22lingo-sub-727170%22%20slang%3D%22en-US%22%3EI%20would%20like%20to%20pass%20to%20Sharepoint%26gt%3BCreate%20file%2C%20a%20variable%20of%20type%20Object%20to%20the%20File%20Content%20param%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-727170%22%20slang%3D%22en-US%22%3E%3COL%3E%0A%3CLI%3EIn%20my%20flow%2C%20depending%20various%20conditions%20I%20am%20using%20distinct%20templates%20to%20create%20a%20word%20document%2C%20using%20%22Populate%20a%20Microsoft%20Word%20template%22.%3C%2FLI%3E%0A%3CLI%3EFor%20each%20case%2C%20I%20store%20the%20created%20file%20in%20a%20variable%20of%20type%20Object%3C%2FLI%3E%0A%3CLI%3ELater%20in%20my%20flow%2C%20once%20I%20handled%20the%20different%20scenarios%2C%20I%20want%20to%20save%20the%20file%20to%20Sharepoint%20(and%20also%20send%20it%20by%20email)%2C%20by%20passing%20the%20created%20variable%20containing%20the%20file.%3CBR%20%2F%3E%3CBR%20%2F%3EUnfortunately%2C%20the%20variable%20of%20type%20Object%20does%20not%20seem%20to%20be%20supported%20to%20save%20the%20file%20to%20Sharepoint%20(nor%20to%20send%20an%20email).%3C%2FLI%3E%0A%3C%2FOL%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-727170%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Flow%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-727199%22%20slang%3D%22en-US%22%3ERe%3A%20I%20would%20like%20to%20pass%20to%20Sharepoint%26gt%3BCreate%20file%2C%20a%20variable%20of%20type%20Object%20to%20the%20File%20Content%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-727199%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F148941%22%20target%3D%22_blank%22%3E%40Fabrice%20Frachon%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECan%20you%20show%20a%20sample%20of%20your%20Flow%20please%3F%20If%20you%20can%20show%20an%20example%20how%20you%20use%20the%20MS%20Word%20template%20connector%20and%20how%20you%20are%20saving%20it%2C%20we%20can%20use%20that%20to%20track%20down%20the%20issue.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECheers%3C%2FP%3E%3CP%3EDamien%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-727451%22%20slang%3D%22en-US%22%3ERe%3A%20I%20would%20like%20to%20pass%20to%20Sharepoint%26gt%3BCreate%20file%2C%20a%20variable%20of%20type%20Object%20to%20the%20File%20Content%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-727451%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20for%20reaching%20out%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F89704%22%20target%3D%22_blank%22%3E%40Damien%20Rosario%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E1.%20Initialize%20variable%3CBR%20%2F%3EName%3A%20wordDocument%3CBR%20%2F%3EType%3A%20Object%3CBR%20%2F%3EValue%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E2.%20Populate%20a%20Microsoft%20Word%20template%20(preview)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E3.%20Set%20variable%3CBR%20%2F%3EName%3A%20wordDocument%3CBR%20%2F%3EValue%3A%20Microsoft%20Word%20Document%20(from%20step%20%232)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E4.%20Create%20file%20(Sharepoint)%3CBR%20%2F%3EFile%20Content%3A%20I%20cannot%20use%20the%20'wordDocument'%20variable.%20I%20can%20only%20pass%20'Microsoft%20Word%20Document'%20from%20step%202%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-727463%22%20slang%3D%22en-US%22%3ERe%3A%20I%20would%20like%20to%20pass%20to%20Sharepoint%26gt%3BCreate%20file%2C%20a%20variable%20of%20type%20Object%20to%20the%20File%20Content%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-727463%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F148941%22%20target%3D%22_blank%22%3E%40Fabrice%20Frachon%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHopefully%20I%20understand%20the%20issue.%20Maybe%20try%20checking%20these%20items%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E1.%20Have%20you%20put%20the%20text%20fields%20into%20Word%20template%20where%20the%20inserted%20text%20needs%20to%20go%3F%20Have%20you%20named%20each%20box%20appropriately%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20custom%20box%20names%20should%20appear%20in%20%3CSTRONG%3EPopulate%20a%20Microsoft%20Word%20template%26nbsp%3B%3C%2FSTRONG%3EIn%20%3CSTRONG%3EMS%20Flow%3C%2FSTRONG%3E.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F121568i35E3B6A105314F0E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22capture20190628164225119.png%22%20title%3D%22capture20190628164225119.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E2.%20Have%20you%20then%20inserted%20values%20(e.g.%20your%20variables)%20into%20these%20boxes%20in%20%3CSTRONG%3EMS%20Flow%3C%2FSTRONG%3E%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E3.%20When%20you%20%3CSTRONG%3ECreate%20file%3C%2FSTRONG%3E%2C%20the%20output%20has%20to%20be%20%3CSTRONG%3E'%3C%2FSTRONG%3E%3CSPAN%3E%3CSTRONG%3EMicrosoft%20Word%20Document'%3C%2FSTRONG%3E%26nbsp%3Bfrom%20the%20%3CSTRONG%3EPopulate%20a%20Microsoft%20Word%20template%3C%2FSTRONG%3E%20as%20that%20has%20the%20variables%20you%20have%20added%20in%20(1).%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EHere's%20a%20diagram%20that%20I%20hope%20illustrates%20the%20point%20in%20Flow.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20617px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F121569i4D6C779B24123E62%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22capture20190628163024727.png%22%20title%3D%22capture20190628163024727.png%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EYou%20can%20insert%20your%20variables%20into%20the%20Populate%20a%20MS%20Word%20template%20fields%20above%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EHope%20that%20helps%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ECheers%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EDamien%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EEDIT%3A%20P.S.%20I%20should%20add%20that%20I%20do%20not%20believe%20the%20variables%20will%20be%20recognised%20as%20appropriate%20file%20content%20thus%20the%20issue.%20You'll%20need%20the%20variables%20to%20be%20input%20into%20the%20Populate%20a%20Microsoft%20Word%20template%20connector%20before%20creating%20the%20file.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-727491%22%20slang%3D%22en-US%22%3ERe%3A%20I%20would%20like%20to%20pass%20to%20Sharepoint%26gt%3BCreate%20file%2C%20a%20variable%20of%20type%20Object%20to%20the%20File%20Content%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-727491%22%20slang%3D%22en-US%22%3E%3CP%3EMy%20issue%20is%20not%20with%20creating%20Word%20documents%20using%20templates.%20I%20am%20able%20to%20create%20and%20save%20Word%20documents%20and%20using%20variables%20to%20populate%20the%20template.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhat%20I%20cannot%20do%2C%20is%20use%20the%20Word%20document%20that%20I%20placed%20in%20a%20Microsoft%20Flow%20variable%2C%20as%20an%20input%20later%20in%20my%20flow%20to%20save%20the%20File%20or%20to%20attach%20to%20an%20email%20(again%20my%20scenario%20is%20that%20the%20Microsoft%20flow%20variable%20is%20used%20to%20support%20that%2C%20depending%20conditions%2C%20the%20Word%20document%20is%20different).%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-727499%22%20slang%3D%22en-US%22%3ERe%3A%20I%20would%20like%20to%20pass%20to%20Sharepoint%26gt%3BCreate%20file%2C%20a%20variable%20of%20type%20Object%20to%20the%20File%20Content%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-727499%22%20slang%3D%22en-US%22%3EOK%20maybe%20try%20using%20Compose%20and%20using%20the%20Set%20initialize%20variable%20output%20as%20the%20source.%20Then%20use%20the%20compose%20box%20output%20as%20the%20file%20content.%3C%2FLINGO-BODY%3E
Highlighted
Microsoft
  1. In my flow, depending various conditions I am using distinct templates to create a word document, using "Populate a Microsoft Word template".
  2. For each case, I store the created file in a variable of type Object
  3. Later in my flow, once I handled the different scenarios, I want to save the file to Sharepoint (and also send it by email), by passing the created variable containing the file.

    Unfortunately, the variable of type Object does not seem to be supported to save the file to Sharepoint (nor to send an email).
5 Replies
Highlighted

Hi @Fabrice Frachon 

 

Can you show a sample of your Flow please? If you can show an example how you use the MS Word template connector and how you are saving it, we can use that to track down the issue.

 

Cheers

Damien

Highlighted

Thanks for reaching out @Damien Rosario 

 

1. Initialize variable
Name: wordDocument
Type: Object
Value:

 

2. Populate a Microsoft Word template (preview)

 

3. Set variable
Name: wordDocument
Value: Microsoft Word Document (from step #2)

 

4. Create file (Sharepoint)
File Content: I cannot use the 'wordDocument' variable. I can only pass 'Microsoft Word Document' from step 2

Highlighted

Hi @Fabrice Frachon 

 

Hopefully I understand the issue. Maybe try checking these items?

 

1. Have you put the text fields into Word template where the inserted text needs to go? Have you named each box appropriately?

 

The custom box names should appear in Populate a Microsoft Word template In MS Flow.

 

capture20190628164225119.png

 

2. Have you then inserted values (e.g. your variables) into these boxes in MS Flow?

 

3. When you Create file, the output has to be 'Microsoft Word Document' from the Populate a Microsoft Word template as that has the variables you have added in (1).

 

Here's a diagram that I hope illustrates the point in Flow.

 

You can insert your variables into the Populate a MS Word template fields aboveYou can insert your variables into the Populate a MS Word template fields above

Hope that helps?

 

Cheers

Damien

 

EDIT: P.S. I should add that I do not believe the variables will be recognised as appropriate file content thus the issue. You'll need the variables to be input into the Populate a Microsoft Word template connector before creating the file.

Highlighted

My issue is not with creating Word documents using templates. I am able to create and save Word documents and using variables to populate the template.

 

What I cannot do, is use the Word document that I placed in a Microsoft Flow variable, as an input later in my flow to save the File or to attach to an email (again my scenario is that the Microsoft flow variable is used to support that, depending conditions, the Word document is different).

Highlighted
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.