How do I keep the extra whitespace when using substring when looping through an array?

Options

I have a sample file above that is downloaded and parsed in xano. I will get “RECORDS” and save it as “Row1”, the client data as “Row2”, and “END” as “Row3”.
Now I'll loop through Row2 per client. I did this by slicing the client data as “Row2” so I can loop through each client data. The client data is separated by a new line. The whitespace between the details are fixed.

When looping through each client, I'll be getting each info: name, date, amount, status.
I have tried using substring to get each info however I have a problem in the substring since xano removes the fixed whitespace in between.
John Doe 01012023 500.00 000000000000000 PAID
becomes:
John Doe 01012023 500.00 000000000000000 PAID
whenever I use substring.

I tried using lambda but it keeps giving me this error:
$auth must be an object

$var must be an object

$env must be an object

$input must be an object

$global must be an object

code must be a string

Is there any way to avoid getting the extra whitespace removed?

Tagged:

Answers

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    The Xano preview is rendered by your browser's HTML, and the rendering guide for HTML removes all the extra spaces. You can see an example of it in your own post above. As a result, it's not a reliable narrator for the actual output of your function.

    To get a more accurate test of your real results, use the “copy” icon in the upper-left when looking at your test output, then paste into your favorite text editor - was the whilte space retained or removed?

    If this issue persists, how about making a loom to show what you are doing?

  • chrstnstl
    Options

    Thank you @Ray Deck. White space is retained when using the copy option. Appreciate your help so much!