Expression evaluation error at function a!safeLink [line 176]: is not a permitted URI under the configured security rules and cannot be cast to safeUri.

Hi,
                              
I am providing link to download report data to excel using below snippet:
                              
                               a!linkField(
label: "Download Link: ",
labelPosition: "ADJACENT",
links:
a!safeLink(
label: "Click here to export to excel",
uri: getdatasubsetdownloadlinkfromprocess(
processModelUuid: "process model uuid",
input: joinarray(enumerate(n),"-"))
)

)


It works fine if provide particular value for "n" say 300 or below. However, if changes this value above 300 report is not appearing, getting below error:
                              
"Expression evaluation error at function a!safeLink [line 176]: is not a permitted URI under the configured security rules and cannot be cast to safeUri."
                              
Report is using on PROD environment that have 1000 of rows. Is the...

OriginalPostID-183322

OriginalPostID-183322

  Discussion posts and replies are publicly visible

  • ...re any workaround for such use case?
    Any help would be appreciated. TIA.
                                  
                                  
  • Passing only value 'n' to the target process model and then use it appropriately inside the process looks to be quick solution to me.
  • @upendram I might be wrong but it seems to me that it's a problem with the 'input' parameter. There is a constraint on the length of the 'input' parameter in the Cloud and On-premise versions of Download Datasubset plugin, and Appian hasn't specified this in it's documentation. This can be concluded or confirmed by varying the length of input(after a certain value, the plugin starts to fail).

    The problem is the same even if you use hardcoded value or a value derived via a function or rule.

    So at any point of time, keep your input as much as simple and perform any processing in the process model and to the best of my knowledge this is the only way to tackle the constraint on 'input' parameter in the Download Datasubset plugin.
  • @sikhivahans Yes you are right..it's all about length. There is a issue with generated URL that is greater than specified length (2043 characters). I was thinking to send all my filters value using JSON and extract data in process model. However, i have multiselect filter that can cause the same error again. Can you please suggest any alternative.
    thanks !!
  • @gouthamk "n" is just for example. Values are coming from the generated datasubset.data.Id based on the filters.
  • Yes, I thought this the same snippet that you were using ! No problem. So as you said, passing filters should simplify the URL and I think even when there are multiples that could be far shorter than passing all ids ?
  • @upendram I couldn't suggest an alternative for this plugin at the moment because to the best of my knowledge it's hard to trespass the limit put on the 'input' parameter. And you can't satisfy the usecase or it's completely difficult or impossible at times if the filters to be applied and the values associated with them increases in length(I am even considering the selected rows as a filter values).

    Though not elegant, you could think of some possible alternatives as follows:
    1. Limit the number of rows (allow a very few) that can be exported to excel if the filters are many and the values associated with them are many.
    2. Export the complete grid to excel. (i.e. you won't be applying any filters. But keep in mind that this plugin is expected to complete within a minute. So exporting a large datasubset could also potentially result in an error.)
    3. Let the user apply any number of filters and let the filters be associated with any number of values and also let the any number of rows be exported (could be all or some). Trigger a process (by using the plugin 'Start Process Writer' at https://forum.appian.com/suite/tempo/records/type/components/item/i8BCLGOdlMUpdGVqT-RV7oRg74uEGJO5yQeCToV_iK9c-uZFaHQndbxbAQOV2CNBg/view/summary) which accepts the filters or datasubset from the report as input, and thereby populate the excel sheet with resultant data and finally sends the initiator(user who clicked the 'Export to excel') an email which contains the excel file as an attachment.