Hello, I want to URL decode the part of the multi-line text HTML in SharePoint if there is an <a href="file:/~</a>.
Since Power Automate does not currently support regular expressions, I was told that using Office Script would be a good option. Could you please tell me how to write it?
I was considering the following, but what do you think?
function main(workbook:ExcelScript.Workbook, targetText:String){
pattern = new RegExp('<a\\shref=\"file:/.*?</a>','g');
return targetText.replace(pattern,function(matched) {
return urlDecode(matched);
});
}
function urlDecode(encodedString:String){
return decodeURIComponent(pattern);
}
I'm currently at home, so I can't use Power Automate.
Thanks a lot in advance!