web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Adding Multiple Spaces...
Power Apps
Answered

Adding Multiple Spaces to a Text Field

(0) ShareShare
ReportReport
Posted on by 19

Is there a way to add a significant number of spaces to a text field, without pressing the space bar 296 times?

 

For example repeat(" ", 296)

 

I am creating a file where every record must be the same length and within each record there are fields that are located at specific start/end positions.

 

I considered using a counter and a forall to create the string, but was hoping there was a simple function like repeat, but can't find one.

 

Thanks

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at
  • Verified answer
    dhaygood73 Profile Picture
    19 on at

    Hi Drrickryp,

     

    Thank you for this suggestion.  I actually decided to just create several variables (Space50, Space25, Space10, Space5) and would combine them to create the amount of "space" I needed in the text file.  So instead of hitting my space bar 296 times (and loosing count), this provided me the ability to reduce potential errors.

     

    Thanks again

  • MilanPijanovic Profile Picture
    26 on at

    Hi,

    You might have run into the problem of adding multiple spaces.
    Looks like PowerApps automatically erases something like that. However, you may instead user Char(127), which is a push of the delete button.

    As of your broader question: You may create a function in a component, that receives a number (length of the string in question) and according to this returns a string of spaces (which are actualy deletes, but no one is going to see that anyways).

    This article may give you an idea on creating such a function:
    Power Apps Custom Functions & Reusable Code - Matthew Devaney



  • JemimaSherley Profile Picture
    7 on at

    Char(127) should work, Fine. 

    Thanks 💗

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 88

#2
WarrenBelz Profile Picture

WarrenBelz 85 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 45

Last 30 days Overall leaderboard