DataAction - Problem in String escaping in Request URL

Hi all,

I'm having a problem regarding the following data action GET /api/v2/flows/datatables/${input.DatatableID}/rows/$esc.url(${input.RowID})?showbrief=false. My input contract in my data action provides de DatatableID and the RowID in order to retrieve the correspondent line of the datatable that I want.

The problem is that in my datatable the key column has spaces and special characters. For that reason I applied the $esc.url() function in my Request URL Template but what I get following response that he can't find the key value.

"errors": [ { "message": "REST call for action execute failed. Message: Request to backend service failed. Response from web service: {"message":"Not found","code":"flows.datatables.row.not.found","status":404,"messageParams":{},"contextId":"adea5e9b-ae13-48f1-8d7c-b42b976ff969","details":[],"errors":[]} [7fed702c-ac1d-4447-a9fd-852ac96356b8]", "code": "NOT_FOUND", "status": 404, "messageParams": {}, "details": [], "errors": [] }

Can someone suggest what I'm doing wrong?

Thanks in advance

Hi Joao,

I suggest encoding the rowId and datatableId manually using a tool before making the request. If that doesn't work the datatableId or rowId may be incorrect. You could also trying making the request with one of the SDK's to ensure everything is correct. The SDK's handle encoding the path variables for you (Avoid using the Go SDK for this however as it currently has a bug where it doesn't correctly encode path variables).

Regards,
Declan

Hi Joao,

I had no trouble reproducing this issue. The problem is that the $esc.url() tool is turning spaces into plus signs (+) instead of %20

I don't see a workaround other than what Declan suggested. Please open up a support ticket for this to help prioritize fixing this.

--Jason

Thanks for your advice Jason and Declan!

Eventually I worked around this issue by replacing "+" with "%20" in the request by doing:

$esc.url(${input.RowID}).replace('+','%20')

I don't know if this is right way to do it but works for us now.

--Joao Cruz

That definitely seems reasonable. I will push to get a real fix for this added to the product in the near future.

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.