Apr 21 2022 04:39 AM - edited Apr 21 2022 05:04 AM
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&web=1&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
Apr 21 2022 05:52 AM
Apr 21 2022 05:59 AM - edited Apr 21 2022 06:05 AM
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...
Apr 21 2022 08:13 AM
Apr 21 2022 08:29 AM
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.
Apr 21 2022 09:25 AM
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
Apr 21 2022 09:57 AM - edited Apr 21 2022 10:02 AM
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.
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
Apr 21 2022 10:05 AM
Hello @Ximo ,
I've not tried it but could this action help remove the HTML tags: Content Conversion - Connectors | Microsoft Docs
Paul
Apr 21 2022 10:25 AM - edited Apr 21 2022 10:30 AM
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)
I am going to try changing the description format to text and see how it goes.
Ximo
Apr 21 2022 12:48 PM
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.
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.
Apr 21 2022 01:23 PM
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
Apr 21 2022 01:42 PM
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!
Apr 21 2022 01:23 PM
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