I have a requirement to show the hyperlink when exported to excel from record grid . The associated DB column has a either a DOC Id or a url .
By exporting ,few fields are shown as desired (both label name with hyperlink), few are just shown with with label and no hyperlink and few are entirely skipped to show the excel.
I have the following sample code.. Is something wrong here?
a!gridColumn( label: "File Name", value: a!linkField(
links:a!safeLink( label: fv!row['recordType!record.fieldname], uri: if( left(fv!row['recordType!record.docImage], 10 ) = "[Document:", document( todocument(fv!row['recordType!record.docImage]), "url" ),fv!row['recordType!record.docImage] )), showWhen:a!isNotNullOrEmpty(fv!row['recordType!record.docImage]),
showwhen:false exportWhen: true, align: "START" ),
Thanks
Discussion posts and replies are publicly visible
Remove duplicate showWhen: false, and convert to document URL only when the value is truly a Doc Id; otherwise keep it as the plain URL.
showwhen: false is not a duplicate . This parameter is being used to hide the column in the UI and I am only exporting it . Yes I am converting to doc url only if it has Doc Id , otherwise its the url itself. But this is somehow not working
The issue seems to be is your uri logic, Some docImage values are not becoming one valid hyperlink, so Excel exports only the label or leaves the cell blank.Validate the failing rows first and check whether docImage contains a proper external URL or a valid Doc Id, because a!safeLink() needs one valid URI per cell and Excel supports only one hyperlink per cell.