SOLVED

Multiple lines of text Custom Field in Project Online

Contributor

Hi all,

I am trying to use a Custom Field based on Multiple lines of text to store a link. The problem is that these Multiple lines CFs are adding extra html characters:

 

<p>​https://xxx.sharepoint.com/:b:/r/sites/xxx/Testing%20Multiline%20Document%20Links/Project%20Documents/Testing%20Multiline%20Document%20Links%20-%20Project%20Document.pdf?csf=1&amp;web=1&amp;e=aSR5xG<br/></p>

 

When we try to use this link in Power Automate the link is broken.

Is there a known JS code that can clean up these html chars and store the text value in the Custom Field?

 

Thank you

 

 

11 Replies

Hello @Ximo ,

It might be easier to use just simple text field to store the URL? 

Paul

Hi @Paul Mather, totally agree, the problem with the simple text field is that the URL length is trimmed when the project name is long, because of that we wanted to check with Multiple lines of text custom field.
On top of that, we are using the modern SharePoint sites and the Copy Link feature does not shorten the URL either...

Ximo,
I'm not sure of the availability of these fields in Project Online but have you tried the Hyperlink, Hyperlink Address, Hyperlink Href or Hyperlink SubAddress fields? They are specifically designed for URL addresses.

John

Thank you @John-project,

I guess you are referring to column types in a SPO List, I wish it was that easy, unfortunately this is a Custom Field in Project Online, here there are no Hyperlink types as in SPO.

 

image.pngimage.png

 

Hello @Ximo ,

Those fields John mentioned are MS Project fields, these are no in PWA. Could you just put a URL into the document library as that URL is possibly shorter?

Paul

Hi @Paul Mather, we use the "document link" Project custom field in the PDP to compose the approval task via SP2013 PWA Workflow (managing the stages) in a list. The value has been manually copied from the Project Documents library and pasted in the PDP. 

 

When the SP2013 PWA Workflow creates the task in the list, Power Automate sends an email with a link to the specific document under approval and the approve/reject buttons. This way they do not need to access the list of tasks and is easier to approve the document.

 

Ximo_0-1650559760189.png

 

Once the user clicks the approve/reject buttons in the Power Automate generated email, the same Power Automate updates the task with the outcome. 

 

A link to the document library as that URL would force the approver to find out what document in the library is the one we are approving, while a link to the specific document is directly opening in the email.

Ximo

 

Hello @Ximo ,

I've not tried it but could this action help remove the HTML tags: Content Conversion - Connectors | Microsoft Docs

Paul

Thanks @Paul Mather, the description of the task arrives without the link in the task list, so Power Automate cannot retrieve it

using html to text with Content Conversion. If we use the single line text custom field all is ok, but trimmered if too long (more than 255 chars)

 

3CA03921-F991-4674-AE6B-9A04BD70F8A9.jpeg

 

I am going to try changing the description format to text and see how it goes.

Ximo

 

 

Changing the description format did not work, the link is only properly populated when the custom field is a single line of text, it is a pity that modern SPO sites still does not have short urls when copying a link to a document.

 

Ximo_1-1650570312211.png

I have tried as well to remove the html tags and characters in SP Designer, in the workflow itself, but no luck. We may start considering returning to classic SPO sites where using the Get a link feature (View link) the link is always short, no matter the length of the filename/project name.

 

 

best response confirmed by Ximo (Contributor)
Solution

@Ximo can you not use the _api/ProjectData API to get the multiline field as this API as the HTML stripped our already?

Paul

Hi @Paul Mather, that sounds good! Updating the Power Automate actions to get the Project Name and the Document type under approval to call the _api/ProjectData API to retrieve the related CF. Maybe with some string manipulation in a Compose action would make the trick as well.

 

Thank you!