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.

Serving data depending on URL

Featured Replies

  • Newbies

Just new to this forum and hoping someone can help me. I am setting up an online store but would like to have some data displayed differently for different regions

My idea is to set up a number of addresses such as region1.company.com, region2.company.com etc but have them all point to the same database.

I would like to capture the address the user is selecting and then display data with an if statement. e.g. if the site region1.company.com. is being used, display data from field1

Is there a way I can capture the URL.

Hope the question makes sense

Richard,

What version of Filemaker are you using? the reason that I ask is that you may be able to have the user input the url information in an opening screen and then carry the value as a token. Then do your if/else statement depending on the token value. The problem is...Filemaker 4.1 only gave you the ability to have one token. Version 5.5 gave you the version to carry multiple tokens....5 I believe. You may want to visit the posts on this page that deals with Tokens. Not real sure if this is the cleanest way to solve your problem. Hope this helps.

Regards

You can do anything with URL in JavaScript.

You can also store that to FM field and then base next steps on that.

  • Author
  • Newbies

Thanks for that. I might look at combining the two options. Using on of the tokens would be the best answer. Could I use javascript to set the token from the URl?

For JavaScript to be processed in FM WC don't use the <!-- --> comments tags.

You can use something like this:

[FMP-If:ClientAddress .eq. region1.company.com][FMP-Field:field1][/FMP-If]

[FMP-If:ClientAddress .eq. region2.company.com][FMP-Field:field2][/FMP-If]

[FMP-If:ClientAddress .eq. region3.company.com][FMP-Field:field3][/FMP-If]

All the best.

Garry

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.