[Bug]: API is broken when using dynamic query strings #36279
Description
Is there an existing issue for this?
- I have searched the existing issues
Description
I have an API where I am conditionally sending query parameters based on some logic. So i created a function getSearchQueryParam
in a JSObject Utils
and the response of will return something like &searchString=<some-value>
.
Now I am calling it directly inside the API along with other query parameters as page={{Table1.pageNo}}&size={{Table1.pageSize}}{{Utils.getSearchQueryParam()}}
But when i checked the evaluated value, it does not show the correct value and the entire string is just replaced by a ~
So then I have to make a workaround by using template literals instead, eg
{{ page=${Table1.pageNo}&size=${Table1.pageSize}${Utils.getSearchQueryParam()}
}} and this show correctly and evaluated fine.
But I am forced to use this workaround which is not readable and I would prefer to use the moustache brackets for all my dynamic values
Attached screenshots below of the issue
and the workaround
Steps To Reproduce
- Create an API with an endpoint
- Add some query parameters like page and size binded with the a Table widgets pageNo and pageSize
- Create a JS function that returns a dynamic query string, eg
searchString=test
- Now append that function directly in the API after the existing parameters, eg &page={{Table1.pageSize}}{{Utils.formatQueryString()}}
You will see that the API does not work as intended, and the evaluated value of the API is broken with a ~
Public Sample App
No response
Environment
Production
Severity
Medium (Frustrating UX)
Issue video log
No response
Version
Cloud