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.

Passing Tokens to FM?

Featured Replies

Is there a way to pass a token from the browser to Filemaker. I have 2 dbs - Users and Products - The user signs in to users which I then get a token from. Then they can view and edit products. What I want to be able to do is let them only see their discounted cost based on their user id.

The only way I've figured to do this is to stay in the User database and create a portal to products with a relationship based on the product code and discount number, but I would like to work directly in the product database and set the token as a global.

Does this make sense?

You may want to see my post to a similar question in the CDML forum under help w/cookies. I think it might answer your token question (no pun intended)

Simon

  • Author

First - my apologies -as I did not see the CDML board and this posting is more topical there.

I read the posts there, and I am already passing tokens - but that doesn't help unfortunately, as what I need to do is figure out how to pass a token to filemaker once an action has been completed so that the information found can be customized based on that token, i.e. do a find and then set the value of the token to a global field.

This sounds like a jod for cookies. Cookies are not hard to implement with CDML, in fact they job is almost trivial since Web Companion takes care of most of the work. The only problem is browser incompatibility handling the cookies...

  • Author

How would cookies help? Can I move a cookie directly to Filemaker?

You sure can move a cookie directly to FMP -- just like you can a token.

The cookie value is "called" with the [FMP-Cookie: cookiename] CDML tag. To get the value into a FMP database you'd need a form with the CDML tag...

<input type="hidden" name="fieldname" value="[FMP-Cookie: cookiename]">

...or something similar could be done by generating a url directly for people to click on.

Alternativerly the cookie value can be used in a [FMP-If] statement in a custom html format file.

  • Author

I know that I can do that - what I need to do though is do a find AND THEN pass the token so that the found records display certain pricing data based on the current user.

Try doing it in the database itself, not in CDML. That is, create a calculation field in the db that works out who the current user is (I dunno how you do that over the web with accuracy, passwords perhaps) and take it from there.

  • 2 weeks later...

shimoda has writter: "I have 2 dbs - Users and Products - The user signs in to users which I then get a token from. Then they can view and edit products. What I want to be able to do is let them only see their discounted cost based on their user id.

"The only way I've figured to do this is to stay in the User database and create a portal to products with a relationship based on the product code and discount number,..."

"- what I need to do though is do a find AND THEN pass the token so that the found records display certain pricing data based on the current user."

The discount number could be a key. If that number is common to a user in User and is common to a price list in Products, you can probably access the Products db through an -inlineaction, by accessing that key number through a -token.

Such syntax might read:

[fmp-inlineaction:-db=Products.fp5,-lay=layoutname,-token=fmp-field:discount_number,-find][fmp-record][fmp-field:item] [fmp-field tongue.gifrice] <br>[/fmp-record][/fmp-inlineaction]

You may not like the display of the results.

FYI, regarding the Form Action entry of the Cookie mentioned above, a similar line of code will get a -token tag from the format file to the database.

If you have successfully designated a -token tag which is a field, the code might read:

<input type="hidden" name="discount_number" value="[fmp-currenttoken:3]">

If you have successfully designated a -token tag which is a -recid, the code might read:

<input type="hidden" name="-recid" value="[fmp-currenttoken:4]">

Hope you find this useful.

Peace

Keith M. Davie

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.