Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Inserting text - probably simple

Featured Replies

Well this is probably simple and I am overlooking how to do it so I hope someone can please assist me.

I have a studentid field that has a number in it. The leading zero is missing on all the numbers in this field because the excel file was formatted incorrectly and it lost the leading zero for every student id.

What I need to do is insert a 0 (zero) in front of each number in the field. I can't figure it out all I manage to do is replace it. :-(

Any help would be greatly appreciated.

Edited by Guest

i tried this in a script and it worked for me:

Insert Calculated Result [select; yourfield; "0" & (GetAsText ( yourfield ))]

i made a button and attached the script to it.

each time i click it it adds a preceeding zero.

you could make it loop through your records to replace all the fields. there may be a better way.

the field is text however.

You should always try to use Set Field instead of Insert Calculated Result. These script steps perform a lot of the same actions but Set Field doesn't require the target field to be on the current layout or any layout. It's better not to marry a script to a layout if you can help it.

Also, I would recommend the following formula since it will handle placing multiple leading zeros if necessary. In the following example, I want 2 leading zeros in from of single digit numbers, 1 leading zero in front of double digit numbers and no leading zeros in front of three digit numbers (i.e. 005, 034, 123).

Set Field [MYTABLE::myfield; Right("00" & MYTABLE::myfield; 3)]

Edited by Guest

i just switched out a use of InsertCalculatedResult to SetField and it certainly does seem nicer.

  • Author

Thank you both. I tried both way and the Setfield was a lot easier because I could not figure out how to end my script when I got to the last record. But with the setfield it did not keep adding zeros :-)

Thank you so very much!! :

Sounds like you are using a looping script to run the Set Field. Typically, the way to exit a looping script is to check the option on the Go to Record/Request/Page step to "exit after last". Or, you could use the formula inside a Replace Field Contents command and it will run the formula on every record in the found set.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.