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

Silly (Easy?) Calc Question

Featured Replies

Hello!

So I have a calc that creates a calc.

For example, the results can be:

"Hello, " & FirstName

and I need to somewhere actually get the "rendered" results of this result, as in:

Hello, John

Thanks!

It would help to know where you are stuck. There really is no need for a calc that creates, "Hello, " & FirstName.

If you plan to use this text in a Send Mail script step, you might create a calc field "EmailText" and have it be something like,

"Hello " & FirstName & "," & &

"Thank you for contacting our company. Blah..."

  • Author

The actual project is more complex than my example, I just wanted to keep my question more simple.

I really do need the generated calc to be actually read as a calc.

I know that I could just make a text object on a layout like:

Hello, <>

And get:

Hello, John

But, how can you actually get FMP to parse text like this into a calc?

If I get the question correctly.

You have a field called Name.

You want to do a calculation that outputs Hello John

when John is entered into the field called Name.

You can do that like this:

Field called Name - under the options for the field select Auto-enter calc and enter this as a calculation:

"Hello" & Name

Un-tick do not replace existing value.

The above calculation, once you enter John into the field called Name will replace John with Hello John or you could do it like this:

Create a new field called Name_Calc for example. Set the field type to calculation and result to text. As a calculation enter "Hello" & Name and that will yield Hello John as a result when John is entered into field called name.

Place the field Name_Calc on your layout where you want it to appear.

Hope this was what you were looking for.

  • Author

I think I found a solution

(Please tell me if there is a better way, I'm always doing 5000 things at work & feel like I'm taking crazy pills!):(

Fields:

Name - Just text, set to john

NameCalc - Set to "Hello ," & Name

Create a layout text object:

nameText (contents are just <>)

Create another calc field:

HelloCalc - Set to:

GetLayoutObjectAttribute("nameText";"content")

Edited by Guest

  • Author

No, I am crazy, that didn't work.

On to plan b (not the pill)....

What about to place ONLY the first two fields ( and STOP ) on your layout ?

Are you trying to display the actual calculation syntax on your layout and the result it gives as in:

Field A will display on the layout: "Hello ," & Name

Field B will display Hello John provided that Name contains value John ?

Or are you simply trying to display Hello John - if later then you can use either of the two examples given.

It would be easier if you explained better what you're after. I guess you want to look at the Substitute() function - this can take text entered by a user (into a field!), and substitute fieldname codes with field contents.

Also check out the Evaluate() function, that enables user to enter a calculation formula (in correct Filemaker syntax), and calculates the formula's result.

  • Author

I'm so busy at wotk right now, I can't give a proper reply, must create a website and fix the backup system and other things within 1.5 hours. Yay!

Basically, I was working with html, using substitute to take when someone types "maintitle" in an html page (for instance) and turn that into <> and piece together all the field definitions and bits of html code to make a calc that basically outputs an html page for an email template from a calc.

I got FMP to perfectly construct the calc to output the html, but the result is never actually recognized as a calc by FMP...

  • Author

FYI - I'll be doing this by just concat - ing all the code pieces & keywords with a function to find text between keywords (hopefully it works!).

Thanks again for the replies and interest, people are great here! :(-D

Create an account or sign in to comment

Important Information

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

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.