Export Button in Record Grid (Long URL links in Excel file)

Certified Senior Developer

I am using the export button in a record grid field. However, when the Excel file is downloaded, some of the fields have long URL links in parentheses next to them. I am not sure how to get rid of the URL links. I think this is because one of the links is a a!recordLink() component and another link is created through a personalized expression rule. Wanted to see if anyone else had insight about this on getting the link to show as normal rather than a super long URL. I have provided a screenshot of what the Excel file looks like below. 

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    I usually do not recommend enabling this feature for multiple reasons for which this can be one.

    My advise would be to disable the export to excel button and instead build your own functionality for which you can completely control the Excel output itself, as well as who may access it.

  • How you have configured that grid column?

    You can pass that generated link from ER in a a!safeLink() and use it an a richTextDisplayField()

    a!gridColumn(
          label: "Test",
          value: a!richTextDisplayField(
            value: a!richTextItem(
              text: "Test",
              link: a!safeLink(uri: "https://www.youtube.com/")
            )
          ),
          align: "START",
          width: "AUTO"
        )

  • Please past the code snippet that you are using to configure the grid column. 

  • 0
    Certified Senior Developer
    in reply to Laurens Weijzig

    This grid is being backed by a record-type. Would it work the same way with record-backed grids and how would I begin on building out the functionality since the export button is currently automatically configured to show up next to the rest of the buttons on the record grid? 

  • 0
    Certified Senior Developer
    in reply to Sanchit Gupta (Xebia)

    This is great however we are currently using a!recordLink() for each row in the grid. I'm not sure if a!safeLink() can replicate that. 

  • 0
    Certified Senior Developer
    in reply to Harshit Bumb (Appyzie)

    There are two columns in the grid that are showing the long URL links:

    This is the first column ("Added To Queue") which is referencing a record link 

    a!gridColumn(
                            label: "Added To Queue",
                            sortField: 'recordType!{c184666d-5062-434d-b978-cb5d0426e17a}IVLIMS_REC_Work_Plan.fields.{availableSamples}availableSamples',                        
                            value: a!richTextDisplayField(
                              value: {
                                a!richTextItem(
                                  text: if(rule!APN_isBlank(fv!row['recordType!{c184666d-5062-434d-b978-cb5d0426e17a}IVLIMS_REC_Work_Plan.fields.{availableSamples}availableSamples']), "0", text(fv!row['recordType!{c184666d-5062-434d-b978-cb5d0426e17a}IVLIMS_REC_Work_Plan.fields.{availableSamples}availableSamples'], "###,###")),
                                )," ",
                                a!richTextIcon(
                                  icon: cons!IVLIMS_STYLE_ICON_LINK_OUT,
                                  caption: "Open Manage Samples Suite",                              
                                  color:"ACCENT",
                                  linkStyle:"STANDALONE",
                                  link: a!recordLink(
                                    label:"Samples Suite",
                                    recordType:'recordType!{c184666d-5062-434d-b978-cb5d0426e17a}IVLIMS_REC_Work_Plan',
                                    identifier:fv!row['recordType!{c184666d-5062-434d-b978-cb5d0426e17a}IVLIMS_REC_Work_Plan.fields.{workflowTemplateID}workflowTemplateID'],
                                    dashboard:"_M4v9Sg",
                                    openLinkIn: "NEW_TAB"
                                  )
                                )
                              }
                            )
                          ), 

    This is the second column ("Updated By") which is using a personalized rule to link to a user's profile 

    a!gridColumn(
                            label: rule!IVLIMS_displayLabel(field: "updatedBy"),
                            sortField: 'recordType!{c184666d-5062-434d-b978-cb5d0426e17a}IVLIMS_REC_Work_Plan.fields.{updatedBy}updatedBy',
                            value: rule!IVLIMS_displayUserOrGroupFormatted(
                              personOrGroup: if(fv!row['recordType!{c184666d-5062-434d-b978-cb5d0426e17a}IVLIMS_REC_Work_Plan.fields.{updatedBy}updatedBy'] = "Administrator",
                              cons!IVLIMS_LABEL_SYSTEM,fv!row['recordType!{c184666d-5062-434d-b978-cb5d0426e17a}IVLIMS_REC_Work_Plan.fields.{updatedBy}updatedBy'])
                            )
                          )

  • 0
    Certified Senior Developer
    in reply to tracyli

    Aight, got your issue now.

    You are trying to add a link to a richTextIcon and due to accessibility issues the icon is not getting displayed in the resulting Excel. Alternatively, you can use altText parameter in richtextIcon() to display an alternate text when icon is not accessible.

  • 0
    Certified Senior Developer
    in reply to Sanchit Gupta (Xebia)

    I've tried using the altText parameter before but it does not get rid of the URL link. Just shows the altText next to the link now.

  • 0
    Certified Senior Developer
    in reply to tracyli

    So, I've tested it myself and it works perfectly fine. Can you please share the latest code?

    a!gridColumn(
          label: "Request",
          sortField: 'recordType!{4159bc7e-822e-44d7-bdea-42ce7ab5c096}AA Maintenance.fields.{eee2f931-999a-4540-bed2-e907dc892c8a}maintenanceId',
          value: a!richTextDisplayField(
            value: a!richTextIcon(
              icon: "circle-o",
              altText: "Test",
              link: a!recordLink(
                label: text(
                  fv!row['recordType!{4159bc7e-822e-44d7-bdea-42ce7ab5c096}AA Maintenance.fields.{eee2f931-999a-4540-bed2-e907dc892c8a}maintenanceId'],
                  "MR0000"
                ),
                recordType: 'recordType!{4159bc7e-822e-44d7-bdea-42ce7ab5c096}AA Maintenance',
                identifier: fv!identifier
              ),
              linkStyle: "STANDALONE"
            )
          ),
          align: "START",
          width: "AUTO"
        )

  • 0
    Certified Senior Developer
    in reply to Sanchit Gupta (Xebia)

    So I tried adding the label in as text within a!recordLink() as you have in the example code, but it still shows the URL in the exported Excel sheet. I'm not sure if this is because I have two rich text components within the grid column. 

    a!gridColumn(
                            label: "Added To Queue",
                            sortField: 'recordType!{c184666d-5062-434d-b978-cb5d0426e17a}IVLIMS_REC_Work_Plan.fields.{availableSamples}availableSamples',                        
                            value: a!richTextDisplayField(
                              value: {
                                a!richTextItem(
                                  text: if(rule!APN_isBlank(fv!row['recordType!{c184666d-5062-434d-b978-cb5d0426e17a}IVLIMS_REC_Work_Plan.fields.{availableSamples}availableSamples']), "0", text(fv!row['recordType!{c184666d-5062-434d-b978-cb5d0426e17a}IVLIMS_REC_Work_Plan.fields.{availableSamples}availableSamples'], "###,###")),
                                )," ",
                                a!richTextIcon(
                                  icon: cons!IVLIMS_STYLE_ICON_LINK_OUT,
                                  caption: "Open Manage Samples Suite",                              
                                  color:"ACCENT",
                                  altText: "Link Out Icon",
                                  linkStyle:"STANDALONE",
                                  link: a!recordLink(
                                    label:text(fv!row['recordType!{c184666d-5062-434d-b978-cb5d0426e17a}IVLIMS_REC_Work_Plan.fields.{availableSamples}availableSamples'],"###,###"),
                                    recordType:'recordType!{c184666d-5062-434d-b978-cb5d0426e17a}IVLIMS_REC_Work_Plan',
                                    identifier:fv!identifier,
                                    dashboard:"_M4v9Sg",
                                    openLinkIn: "NEW_TAB"
                                  )
                                )
                              }
                            )
                          ),