Use PDIs? Take our 5-minute survey to help shape the PDI roadmap.

unable to get hyperlink in outlook using flow

pilli vinya
Tera Contributor

Hi Team,

 

could you please help me on this. iam creating a change bridge line.

but with href is also not able to get.

here is the script in flow

var content = {
contentType: "HTML",
content:
"<html><body>" +
"<p><b>Change Number:</b> " + fd_data.trigger.current.number + "</p>" +
"<p><b>Short Description:</b> " + fd_data.trigger.current.short_description + "</p>" +
"<p><b>Planned Start Date:</b> " + fd_data.trigger.current.start_date + "</p>" +
"<p><b>Planned End Date:</b> " + fd_data.trigger.current.end_date + "</p>" +
"</body></html>"
};

return content;

10 REPLIES 10

Suryansh Verma
Mega Sage

Hello @pilli vinya 

 

The Create Meeting action already has separate Body and Content Type inputs. Therefore, the Body script should return only an HTML string and not an object containing contentType and content.

Set Content Type = HTML and return a complete anchor tag containing an absolute ServiceNow URL:

var changeUrl =
    gs.getProperty('glide.servlet.uri') +
    'change_request.do?sys_id=' +
    encodeURIComponent(
        String(fd_data.trigger.current.sys_id || '')
    );

return '<p><b>Change Number:</b> ' +
    '<a href="' + changeUrl + '">' +
    GlideStringUtil.escapeHTML(
        String(fd_data.trigger.current.number || '')
    ) +
    '</a></p>';

 

The previous script returned {contentType: "HTML", content: "..."}, which can be serialized incorrectly because the action itself constructs the Microsoft Graph body object. Also ensure the anchor uses a complete absolute URL rather than only change_request.do?sys_id=....

 

If it is helpful, please mark it as helpful and accept the correct solution by referring to this solution in the future, it will be helpful to them.