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.

set a field contents based on field name

Featured Replies

This is a little difficult to describe, so I hope it ends up clear enough:

I have a database with the following fields

f1, text

f2, text

f3, text

f4, text

f5, text

G_Temp, global text

Serial, a unique serial number

RK_First, calculation containg "1"

There is a relationship (FirstRecord) linking RK_First with Serial to give every record access to record 1.

The database has two records.

f1 through f5 in record 1 contains column headings

f1 through f5 in record 2 contain random text.

What I need to do is write a script that steps through the fields in record 2 and sets G_Temp to the data contained in the corresponding column heading contained in record 1 for whatever field it is currently in.

An example of the script I am trying to get working:

Loop

Go to Next Field

Set Field ["G_Temp", "FirstRecord::Status(CurrentFieldName)"]

Pause/Resume Script[]

End Loop

Specifying "FirstRecord::Status(CurrentFieldName)" obviously isn't going to work because it look sfor that exact field name...

Can anyone see a way to acheive what I'm trying to do?

To explain why I need to do this, I actually have more like 5000 fields, and I'm looking for a way to seperate these out into multiple records instead of 1 record with multiple fields. The column heading needs to be applied to each field though.

Example:

Currently have this database -

Record 1 - Heading A, Heading B, Heading C, Heading D, Heading E

Record 2 - Data AAAA, Data BBBB, Data CCCC, Data DDDD, Data EEEE

Need to end up with new database -

Record 1 - HeadingA, Data AAAA

Record 2 - HeadingB, Data BBBB

Record 3 - HeadingC, Data CCCC

Record 4 - HeadingD, Data DDDD

Record 5 - HeadingE, Data EEEE

I can acheive this by setting another global field to contain the current record number, and using goto record steps to jump back and forth, but I'm wondering if anyone else can come up with something a touch more elegant, and possibly faster.

Cheers all,

Sean.

Hi Sean

You're looking for the GetField function. In your situation it would work like this:

Set Field ["G_Temp", GetField(FirstRecord::Status(CurrentFieldName))]

hth

Ian

  • Author

Hi Ian,

That does indeed help!

Exactly what I was looking for.

That makes my script so much better.

Many thanks, hope I can return the favour someday.

Sean.

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.