cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

How to create a file of content type "Link to document" using Flow

Hey,

 

We're building a Flow archiving solution as following:

1) Ask for archiving approval

2) Copy document to target archiving drop-off library

3) Create a file of content type "Link to document" in the source location (using target copy location document-id URL)

4) Delete the original file

 

I'm having issues creating the "Link to document" file. 

 

I thought we don't have to do much, just fill in the body of the aspx file with variables? I'm currently using this body:

<%@ Assembly Name='Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' %>
<%@ Register TagPrefix='SharePoint' Namespace='Microsoft.SharePoint.WebControls' Assembly='Microsoft.SharePoint' %>
<%@ Import Namespace='System.IO' %>
<%@ Import Namespace='Microsoft.SharePoint' %>
<%@ Import Namespace='Microsoft.SharePoint.Utilities' %>
<%@ Import Namespace='Microsoft.SharePoint.WebControls' %>
<html xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882">
<head> <meta name='progid' content='SharePoint.Link' /> 
    <html xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882">
        <Head> <META Name='progid' Content='SharePoint.Link'>
        <!--[if gte mso 9]><xml>
        <mso:CustomDocumentProperties>
        <mso:URL msdt:dt="string">{DOCUMENT-ID-LINK}, {DOCUMENT-ID-LINK}</mso:URL>
        <mso:ContentType msdt:dt="string">Link to a Document</mso:ContentType>
        </mso:CustomDocumentProperties>
        </xml><![endif]-->
        </head>
            <body>
                <form id='Form1' runat='server'>
                    <SharePoint:UrlRedirector id='Redirector1' runat='server' />
                </form>
            </body>
</html>

What mistakes am I making? Anyone that succesfully did this?

 

If you see smilies in the code, it stands for ': o' without the space.

 

Greetings,
Pieter

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
New Member

Re: How to create a file of content type "Link to document" using Flow

When posting here I noticed the aspx code still had a condition in it:

 <!--[if gte mso 9]>

 Removing it gave me a functional test result that I can tune further.

 

Basicly what you do is:

1) create a variable where you write the .aspx body

2) fill in the URL dynamicly (x2) with fe document-id URL

3) create a file %NAME%.aspx with the variable as body

 

It will show in your document library as content type "link to document" and redirect to the document.

 

Final version of my aspx:

<%@ Assembly Name='Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' %><%@ Register TagPrefix='SharePoint' Namespace='Microsoft.SharePoint.WebControls' Assembly='Microsoft.SharePoint' %><%@ Import Namespace='System.IO' %><%@ Import Namespace='Microsoft.SharePoint' %><%@ Import Namespace='Microsoft.SharePoint.Utilities' %><%@ Import Namespace='Microsoft.SharePoint.WebControls' %><html xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"><head> <meta name='progid' content='SharePoint.Link' />     <html xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882">        <Head> <META Name='progid' Content='SharePoint.Link'>        <xml>        <mso:CustomDocumentProperties>        <mso:URL msdt:dt="string">%LINK%, %LINK%</mso:URL>        <mso:ContentTypeId msdt:dt="string">0x01010A005A4361D0FEAE754C8FE9B784B29F63FF</mso:ContentTypeId>        <mso:IconOverlay msdt:dt="string">|docx?d=wf5c8d0e0ffbe4f86ae88897198016f4d|linkoverlay.gif</mso:IconOverlay>        </mso:CustomDocumentProperties>        </xml>        </head>            <body>                <form id='Form1' runat='server'>                    <SharePoint:UrlRedirector id='Redirector1' runat='server' />                </form>            </body></html>

View solution in original post

2 REPLIES 2
Highlighted
New Member

Re: How to create a file of content type "Link to document" using Flow

 
Highlighted
New Member

Re: How to create a file of content type "Link to document" using Flow

When posting here I noticed the aspx code still had a condition in it:

 <!--[if gte mso 9]>

 Removing it gave me a functional test result that I can tune further.

 

Basicly what you do is:

1) create a variable where you write the .aspx body

2) fill in the URL dynamicly (x2) with fe document-id URL

3) create a file %NAME%.aspx with the variable as body

 

It will show in your document library as content type "link to document" and redirect to the document.

 

Final version of my aspx:

<%@ Assembly Name='Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' %><%@ Register TagPrefix='SharePoint' Namespace='Microsoft.SharePoint.WebControls' Assembly='Microsoft.SharePoint' %><%@ Import Namespace='System.IO' %><%@ Import Namespace='Microsoft.SharePoint' %><%@ Import Namespace='Microsoft.SharePoint.Utilities' %><%@ Import Namespace='Microsoft.SharePoint.WebControls' %><html xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"><head> <meta name='progid' content='SharePoint.Link' />     <html xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882">        <Head> <META Name='progid' Content='SharePoint.Link'>        <xml>        <mso:CustomDocumentProperties>        <mso:URL msdt:dt="string">%LINK%, %LINK%</mso:URL>        <mso:ContentTypeId msdt:dt="string">0x01010A005A4361D0FEAE754C8FE9B784B29F63FF</mso:ContentTypeId>        <mso:IconOverlay msdt:dt="string">|docx?d=wf5c8d0e0ffbe4f86ae88897198016f4d|linkoverlay.gif</mso:IconOverlay>        </mso:CustomDocumentProperties>        </xml>        </head>            <body>                <form id='Form1' runat='server'>                    <SharePoint:UrlRedirector id='Redirector1' runat='server' />                </form>            </body></html>

View solution in original post

Helpful resources

Announcements
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (8,242)