Use Case: Passing 50 Blank Spaces as a Parameter in an API Request
Requirement
We have an integration requirement where a specific API parameter must contain exactly 50 blank spaces as its value.
Challenge
While attempting to store the 50 spaces in a standard PEGA property, the platform appears to trim the whitespace and persist the value as null/empty. As a result, the original sequence of spaces is lost before the API request is generated.
Observations
When assigning 50 spaces to a parameter page property (for example, Param.SpaceValue), the value is retained correctly.
When assigning the same value to a regular PEGA property, the whitespace is removed and the property becomes empty/null.
This behavior was verified by checking the length function in parameter and standard PEGA property.
Question Has anyone encountered a similar requirement or platform behavior? What would be the recommended approach to preserve and pass exactly 50 spaces in an outbound API request without PEGA trimming or normalizing the value?
Any suggestions, best practices, or alternative implementation approaches would be greatly appreciated.
Thank you.
Seems like a strange requirement. Not sure what is the purpose of it. I am assuming the API service is a legacy system which is stuck in the past . Just kidding…
You have the below codes representing HTML space strings which can be passed in the your API parameter.
‘“ ”’ = 1 space
‘“&emsp”’ = 2 spaces
‘&ensp’ = 3 spaces
Let the service team know that they just have to render this as Rich text on their end so that they will see the spaces.
Thank you for your input. My understanding is that this approach would only affect how the value is rendered in the web browser when displayed on the UI. In our case, the API call is executed entirely in the backend, and the receiving system will process the request parameters directly in the backend before returning the appropriate response. Therefore, front-end rendering behavior would not apply to this scenario.
For that reason, I wanted to understand whether PEGA provides a standard way to store and preserve a fixed number of spaces (for example, 50 consecutive spaces) within a standard property so that the exact value can be passed in the backend API request.
You’re correct, pega trims the empty space for UI. I asked around and most agree that doing this at the last minute would be the way to go. However, I’m not aware of any standard way to do this.
“Maybe store the quoted/escaped value in a property and then ‘unquote’ / ‘unescape’ the value just before mapping to your integration technology?”
“pass the 50 spaces as parameter to the connector?”
I agree with @JayachandraSiddipeta . This is a strange requirement. Check with the API if they can remove the delimiters (start and end character). If not, why they need to pass 50 spaces everytime?