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.

Is this allowed with Set Field?

Featured Replies

Hi,

I have worked with Filemaker, but not the scripting abilities very much. I'm trying to modify an application written by someone else.

I'm trying to take the text from one field and modify it and write it out to another field. The text field, gPIDtemp1, contains XML that looks something like this

<?xml version="1.0" encoding="UTF-8"?>

<pidList xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blahblahblah.../getNextPIDInfo.xsd">

<pid>dummy:34</pid>

</pidList>

I'm using Set Field like so

 

Set Field["gPIDtemp2", "Replace(GetField(gPIDtemp1), 1, Position(GetField(gPIDtemp1), "<pid>", 1,1)+5, "")"]

Set Field["PID","Replace(GetField(gPIDtemp2), Position(GetField(gPIDtemp2), "</pid>", 1, 1), 18, "")"]

Is this valid?

I'm not getting any error nor is Filemaker crashing. But it's not working as I expect. I'm a Perl and PHP programmer and usually something similar to this would work with those languages.

Any tips would be appreciated.

Thanks,

Jack

I think you need to change GetField(gPIDtemp1) to gPIDtemp1, and the same for GetField(gPIDtemp2). The getfield function is interpreting the contents of gPIDtemp1 to be the name of a field which it then tries to return the contents of. You are adding a level of indirection which you don't want.

Also, you may be able to do what you want more easily using the Substitute function, but I didn't really analyze what you are doing in any detail.

  • Author

Thanks so much! That fixed the problem.

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.