cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
PTemmerman
Level: Powered On

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-comSmiley SurprisedfficeSmiley Surprisedffice" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882">
<head> <meta name='progid' content='SharePoint.Link' /> 
    <html xmlns:mso="urn:schemas-microsoft-comSmiley SurprisedfficeSmiley Surprisedffice" 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
PTemmerman
Level: Powered On

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-comSmiley SurprisedfficeSmiley Surprisedffice" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"><head> <meta name='progid' content='SharePoint.Link' />     <html xmlns:mso="urn:schemas-microsoft-comSmiley SurprisedfficeSmiley Surprisedffice" 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
PTemmerman
Level: Powered On

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

 
PTemmerman
Level: Powered On

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-comSmiley SurprisedfficeSmiley Surprisedffice" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"><head> <meta name='progid' content='SharePoint.Link' />     <html xmlns:mso="urn:schemas-microsoft-comSmiley SurprisedfficeSmiley Surprisedffice" 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

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 373 members 4,972 guests
Please welcome our newest community members: