Skip 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.

Script for Cutting x Lines of Data From One Field To Another

Featured Replies

I can't figure this out but I'm guessing it should be easy some.

I have a database that already has a text entry field with many lines of data.

Let's call that field "DataEntry1".

I have new text entry field on the layout that is blank.

Let's call that field "DataEntry2"

I would like to create a script that will leave the first 10 lines of data as-is for "DataEntry1", and cut/paste all the rest of the text data/lines into the new field "DataEntry2".

This would be a loop for the entire database.

(It's fine if the "DataEntry2" field runs more than 10 lines or even an unlimited amount of lines.)

I was thinking maybe PatternCount(DataEntry1, "¦") >= 10 to see how many carriage returns were found, but I'm a bit stumped here on what sounds like an easy task.

Any help is greatly appreciated. Thanks.

Try this on a copy of your DB ( the replace step isn't undoable )

Show All Records

Replace Field Contents [ No dialog; YourTable::DataEntry2 ; [color:red]***Replace with calculated result:***

Let(

text = MiddleValues ( YourTable::DataEntry1 ; 11 ; ValueCount ( YourTable::DataEntry1 ) ) ;

Left ( text ; Length ( text ) - 1 )// This eliminates the extra ¶ added by the function MiddleValues ( )

)

]

Replace Field Contents [ No dialog; YourTable::DataEntry1 ; [color:red]***Replace with calculated result:***

Let(

text = MiddleValues ( YourTable::DataEntry1 ; 1 ; 10 ) ;

Left ( text ; Length ( text ) - 1 )// This eliminates the extra ¶ added by the function MiddleValues ( )

)

]

Commit Records/Requests [ ]

  • Author

raybaudi, I really want to thank you for this help!

This worked perfectly on the first try!

Thank you so much!

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.