Update Hyperlink and description using Flow HTTP request

%3CLINGO-SUB%20id%3D%22lingo-sub-1640419%22%20slang%3D%22en-US%22%3EUpdate%20Hyperlink%20and%20description%20using%20Flow%20HTTP%20request%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1640419%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20library%20where%20Documents%20can%20replace%20another%20document.%3C%2FP%3E%3CP%3EWhat%20I%20want%20to%20do%20is%20to%20choose%20which%20document%20that%20should%20be%20replaced%20and%20I%20do%20this%20with%20a%20lookup%20in%20the%20form%20when%20createng%20the%20document.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20problem%20is%20that%20documents%20can%20be%20archived%20and%20moved%20to%20another%20library%20and%20then%20the%20lookup%20column%20will%20be%20empty%20on%20the%20new%20document.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20solution%20is%20to%20use%20a%20flow%20that%20when%20a%20document%20is%20created%20and%20replaces%20another%20document%20I%20will%20create%20a%20hyperlink%20to%20the%20document%20selected%20in%20the%20lookup%20field.%3C%2FP%3E%3CP%3EThe%20problem%20is%20that%20I%20can%20not%20set%20both%20URL%20and%20description%20in%20Flow.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20guess%20I%20have%20to%20use%20a%20HTTP%20request%20but%20I%20dont%20know%20how%20to%20do%20it.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%2C%20I%20need%20to%20set%20a%20hyperlinkfield%20on%20a%20document%20with%20a%20link%20and%20description%20to%20another%20document%20using%20flow.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1640419%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Flow%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1641677%22%20slang%3D%22en-US%22%3ERe%3A%20Update%20Hyperlink%20and%20description%20using%20Flow%20HTTP%20request%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1641677%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F620806%22%20target%3D%22_blank%22%3E%4036048419%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3EYou%20would%20need%20a%20post%20request%20similar%20to%20the%20one%20shown%20underneath.%3CBR%20%2F%3EWhereby%20the%20type%20as%20well%20as%20the%20field%20value%20may%20differ%20in%20our%20case%20(blue%20outlines).%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Micca0815_0-1599489036214.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F216889i2C449C426EC2DD9E%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22Micca0815_0-1599489036214.png%22%20alt%3D%22Micca0815_0-1599489036214.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3Eto%20not%20to%20crawl%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fsp-add-ins%2Fcomplete-basic-operations-using-sharepoint-rest-endpoints%23http-operations-in-sharepoint-rest-services%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EREST%20reference%3C%2FA%3Es%20you%20might%20want%20to%20use%20the%20following%20URL%20in%20a%20browser%20and%20adjust%20the%20bold%20characters%20according%20to%20your%20list%20(last%20one%20is%20an%20item%20id).%3CBR%20%2F%3E%3CBR%20%2F%3Ehttps%3A%2F%2F%3CSTRONG%3ESITEURL%3C%2FSTRONG%3E%2F_api%2Fweb%2Flists%2Fgetbytitle('%3CSTRONG%3ELISTTITLE%3C%2FSTRONG%3E')%2Fitems(%3CSTRONG%3E1%3C%2FSTRONG%3E)%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20returned%20XML%20should%20include%20everything%20you%20need%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Micca0815_1-1599489916756.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F216890iB0ECE98508B21C8F%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22Micca0815_1-1599489916756.png%22%20alt%3D%22Micca0815_1-1599489916756.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThe%20more%20properly%20defined%20syntax%20for%20the%20call%26nbsp%3B%20than%20mine%20can%20be%20found%20at%20this%20%3CA%20href%3D%22https%3A%2F%2Fwww.c-sharpcorner.com%2Farticle%2Fsharepoint-rest-api-in-power-automate-ms-flow%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ec-sharpcorner%20blog%20post%3C%2FA%3E.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1647780%22%20slang%3D%22en-US%22%3ERe%3A%20Update%20Hyperlink%20and%20description%20using%20Flow%20HTTP%20request%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1647780%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F258656%22%20target%3D%22_blank%22%3E%40Micca0815%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20and%20sorry%20for%20the%20late%20rely%2C%20I%20will%20test%20this.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Contributor

I have library where Documents can replace another document.

What I want to do is to choose which document that should be replaced and I do this with a lookup in the form when createng the document.

 

The problem is that documents can be archived and moved to another library and then the lookup column will be empty on the new document.

 

The solution is to use a flow that when a document is created and replaces another document I will create a hyperlink to the document selected in the lookup field.

The problem is that I can not set both URL and description in Flow.

 

I guess I have to use a HTTP request but I dont know how to do it.

 

So, I need to set a hyperlinkfield on a document with a link and description to another document using flow.

3 Replies

@36048419 
You would need a post request similar to the one shown underneath.
Whereby the type as well as the field value may differ in our case (blue outlines).

Micca0815_0-1599489036214.png

to not to crawl the REST references you might want to use the following URL in a browser and adjust the bold characters according to your list (last one is an item id).

https://SITEURL/_api/web/lists/getbytitle('LISTTITLE')/items(1

The returned XML should include everything you need:

Micca0815_1-1599489916756.png

The more properly defined syntax for the call  than mine can be found at this c-sharpcorner blog post.

@Micca0815 

 

Thank you and sorry for the late rely, I will test this.

I entered the URL but got this back

This XML file does not appear to have any style information associated with it. The document tree is shown below.
#
<m:code>-2130575338, System.ArgumentException</m:code>
<m:message xml:lang="en-US">Item does not exist. It may have been deleted by another user.</m:message>
</m:error>#
 
This is for the start page of the site.
 
If I use the site where the library is located I just get "not found " the in browser.