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.

valuelists: ID + Description

Featured Replies

  • Newbies

Hi all,

i'm very new to filemaker & cdml and i have a q:

how to use a valuelist with two values ID and Description, show the description but store the ID? ... it should be sooo simple, but i cant make it work frown.gif

thanks in advance

I think this is what you want...

Create a separate file ("ValueLists.fp5") with two fields, "ID" and "Description".

In the main file, create a value list that is the contents of the "Description" field in ValueLists.

Create a relationship between the field in the main file and the "Description" field in ValueLists.

Create a calc field in the main file that returns the related "ID" -- or, if the information in the ValueLists file is edited occasionally, make it a text field that auto-enters the related "ID". You don't have to put that field on any layout, but the info will be there.

HTH,

Dan

  • Author
  • Newbies

quote:

Originally posted by danjacoby:

I think this is what you want...

....

HTH,

Dan

nopes, what i need is to select a client showing the name but storing the ID

on filemaker works great, but on the web it shows only IDs (not descriptions) by using this code:

<select name="ClienteID">

<OPTION VALUE="">- Seleccionar Cliente -

[FMP-valuelist:ClienteID,list=SeleccionarClientes]

<OPTION VALUE="[FMP-valuelistitem]">[FMPvaluelistitem]

[/FMP-valuelist]

</select>

the valuelist is defined using ClienteID and CliNombre as second field.

i'd like to get access to each field of the valuelist separately

thanks

mlt

Well, Not real sure on the Web side of things if this will work, but it's what I use for my solutions. You have 2 fields on your layout, One for ID and the Other for description. Your ID field will be the pop-up that uses the ID as its primary value and the Description as a secondary value. Sort by the secondary value(description). Then On the Description Field in your layout make it a button that uses the "goto field" command and point it to the ID field. Check the box that says "select/perform". Then Lay the Description Field on top of the ID field. So in browse mode, when you click the field, it shows a list of descriptions(and IDs), and when you select one, the description shows in the Description field. Because its ontop of the ID, you never see the ID unless your in the popup window.

Also make sure your Description field has lookup to the description in the child file based on the ID field.

Hope this helps

  • Author
  • Newbies

ASNL:

thats the idea i had ... but thought there has to be a built-in solution for this kind of things frown.gif

besides the web is my real problem, but thanks just for the response!

mlt

  • Newbies

The easiest way to use this for the web use is to forget about using the value lists and instead create a calculated field in the table where the desired values are stored. Use the following def for the calculated field:

"<OPTION VALUE="""&ID&""">"&DESCRIPTION&"</OPTION>"

Then create a script that goes through all the records and exports this calculated field to a txt file in your web folder.

In your web page use the [FMP-INCLUDE: textfile.txt] between the SELECT tags.

Then setup some script that exports a new file everytime you add/edit a record to the file that contains the list information. Or... do what I do and run a weekly update.

  • Author
  • Newbies

... very clever =)

... but i discovered the [fmp-inlineaction] tag ... it will do the job!

thanks ... (maybe i'm using your idea for other purpouses)

mlt

ps=i still think that these are only patches ... FM *should* do this job !

quote:

Originally posted by pimpin:

The easiest way to use this for the web use is to forget about using the value lists and instead create a calculated field in the table where the desired values are stored. Use the following def for the calculated field:

"<OPTION VALUE="""&ID&""">"&DESCRIPTION&"</OPTION>"

Then create a script that goes through all the records and exports this calculated field to a txt file in your web folder.

In your web page use the [FMP-INCLUDE: textfile.txt] between the SELECT tags.

Then setup some script that exports a new file everytime you add/edit a record to the file that contains the list information. Or... do what I do and run a weekly update.

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.