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.

Text Parsing multiple times into one field

Featured Replies

Hi All,

I am trying to parse text from a Job Card Items table into the related Job Card and not getting the correct result.. as the Items in the Job Card are completed any anomalies have to be reported on the Job Card and with up to 50 items in the Job Card Items there may be more than one anomaly to report, (very rarely more than two) . If the Findings field is empty I am just inserting the Variables but when the field already contains data I am using this to parse the text:

Position ( JobCard::Findings ; ":" ; 1 ; 1 )&¶ & $ProdName &" "& $ItemLocation & " " & $QItemSerial

On the second insertion I am getting this:

PR00023 FC iLLume Unit FC0000084 Unit damaged:46

PR00023 FC iLLume Unit  FC0000084

 

Where is the 46 coming from ?

40 minutes ago, Oyseka said:

Where is the 46 coming from ?

What do you expect to get as the result of:

Position ( JobCard::Findings ; ":" ; 1 ; 1 )

?

 

I am not sure what exactly you're trying to achieve here. If the target field already contains data, and you want to append new information to the existing data, you should be setting the field to:

JobCard::Findings & ¶ & $ProdName &" "& $ItemLocation & " " & $QItemSerial

 

 

  • Author

Thank you so much comment. I had never tried to parse into a single field more than once so I thought, (obviously erroneously), that I had to set a starting position for the next text to be appended.

10 minutes ago, Oyseka said:

I thought, (obviously erroneously), that I had to set a starting position for the next text to be appended.

You would have to know the starting position only if you wanted to insert the new text into the existing one. Then you would use this position in a calculation using the Replace() function, for example.

  • Author

If I had used INSERT, having got the cursor position that I wanted to INSERT from, how would I specify that in the calculation as I can see no PositionCursor step. ?

The cursor position is irrelevant if you're doing this within a Set Field[] step.

Just to make this point clear: you could make your script place the cursor at the wanted position using the Set Selection[] script step, then use the Insert Calculated Result[] step to insert new text at that point. But that's not what I meant. Unless you are assisting the user in data entry, it's best to stay at the data level and modify the field's value using Set Field[], without entering the field.

Within the Set Field[] calculation, you can use the Replace() function to insert new text at a calculated position. For example, if the target field contains:

First sentence. Last sentence.

then setting it to:

Replace ( Target ; Position ( Target ; ". " ; 1 ; 1 ) + 2 ; 0 ; "New sentence. " )

would result in:

First sentence. New sentence. Last sentence.

 

  • Author

Absolutely splendid, thank you comment, superb clarity

Create an account or sign in to comment

Important Information

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

Account

Navigation

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.