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.

Mock Importing wiht IWP

Featured Replies

I want create new records based on a flag in a seperate table using a script that IWP (Instant Web Publishing) compatible.

Normal if I did not need it to be IWP, I would find the flag, and import those records.

What is the best way to automate this process, so that it is IWP compatible?

IWP is pretty flexible in allowing you to run scripts and do a lot of things.

To bypass the Import function you can either make use of global fields and a relationship that links the 2 tables together so that data can be sent to the global fields in the destination table OR you can get more creative if you want to try your hand at data parsing and just send all the relevant data in a single data string via the script parameter to the destination table when you execute the create script there.

Here is an example using the global fields approach:

## sample fields in Table 1 (source table)

## ID, Name, Phone, MarkFlag

##

## sample fields in Table 2 (destination table)

## ID,Name,Phone,GlobalID,GlobalName,GlobalPhone

Table 1 (Script Name: Locate/Send Records)

Enter Find Mode

setfield [MarkFlag]["x"]

Perform Find

Go to Record/Request FIRST

Loop

Setfield[table2::globalID][iD]

Setfield[table2::GlobalName][Name]

Setfield[table2::GlobalPhone][Phone]

Perform Script[Table 2:Create Record]

Go to Record/Request NEXT ; EXIT AFTER LAST

End Loop

Table 2 (Script Name: Crete Record)

New Record/Request

Setfield [iD] [GlobalID]

Setfield [Name] [GlobalName]

Setfield [Phone] [GlobalPhone]

commit record/request NO DIALOG

  • Author

Thanks,

I actually went with script parameter idea. Over all it seems smoother.

One last question. I have a global text field, and I use the first word for the new record, is there a way cut or delete the first word in a calculation?

  • Author

it may not be the smoothest way, but I figured it out

I set up a second gbl_text field, that is:

set field(right words (gbl_text;wordcount(1stGbl_text) -1)

the:

Set (1st Gbl_text = the gbl_text)

To cut or delete a word in a field or variable use:

trim(Replace ( globalText ; 1 ; length( leftwords( globalText ;1) ) ; "" ))

This will remove the first word from your text field which in this example is called globalText.

If you just want to grab the first word just use:

leftwords(globaltext ; 1)

Wouldn't

RightWords ( text ; WordCount ( text ) - 1 )

be simpler?

Yep it would. : I reread the post and realized that rightwords is a better way.

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.