I am trying to do something relatively simple: create a PureCloud dataction to look up for a row in a data table. the use case is to look up from a Script.
The problem is that my rowId can contain spaces. I can totally do the following from API Explorer:
GET /api/v2/flows/datatables/c3dcae56-7c7c-488a-825e-64ebda01f00c/rows/Heritage Payment Query?showbrief=false
However, the same request from a Data Actions fails:
**7. Execute: The request could not be understood by the server due to malformed syntax.**
* Failed due to malformed requestUrlTemplate. Illegal character in path at index 105: https://api.mypurecloud.com.au/api/v2/flows/datatables/c3dcae56-7c7c-488a-825e-64ebda01f00c/rows/Heritage Payment Query?showbrief=false
Is there anything obvious that I am not seeing there? I have tried URL escaping the spaces but then of course the row is not found...
edit: $esc.url() seems to escape space with '+' rather than '%20'
I can't think of a way to escape space with '%20' in a simple way - I mean with a single velocity macro.
It doesn't mean there is none - I haven't used escaping in Data Action a lot so far.
What I could think of - at least to manage space character - was to do the following.
Assuming tableId and rowId are my parameter names in the Input Contract.
In my Configuration Request, I have set requestUrlTemplate the following way:
If there are no easier methods to do this, could you request this as a new feature (macro for URI encoding in Data Action - sharing this use case) at https://genesyscloud.ideas.aha.io/ ?
I created internal ticket BPIVR-2152 for this issue. It appears that the esc.url method is for HTML form encoding, not the URL. We need to look into it further.
Jerome's example could be simplified a little bit by getting rid of the set. This is what I had in the simple UI mode request template: