Storing #N spaces in Pega property

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.

Hi @RAHULK0923

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 :wink: . Just kidding…

You have the below codes representing HTML space strings which can be passed in the your API parameter.

’ ’ = 1 space

’ ’ = 2 spaces

’ ’ = 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.

Try it and let us know if it works.

Regards

JC