Software Venture Consulting

FileMaker Pro downloads & Resources
FileMaker Custom Functions
FileMaker Web Viewer Examples
FileMaker Pro & Lasso Consulting
Training
FileMaker Books
FileMaker Articles
FileMaker Error Reference

Free Web Tools
Free FileMaker Tools

Personal Pages
Videos
Adventures
Links

Shopping Cart
Shopping Cart

Search:

Free Newsletter
Signup


Contact


Privacy Policy



FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.

 

 FileMaker Pro Custom Functions

List  |  Show Random  |  Upload  |  Add This to Your Site

GetLayout (value)

Rate this function:  

RatingRatingRatingRatingRating
  Average rating: 4.5  (26 votes)
  Discuss this Custom Function

Michael Bijnens, freelance developer
/

Get layoutid or layoutname from given value

Sample Input:
1) GetLayout (layoutname)
2) GetLayout (layoutid)
Sample Output:
1) result will be an ID of layoutname
2) result will be a layoutname of given layoutid


 Then copy & paste into FileMaker Advanced's Edit Custom Function window.

Click here to copy To Clip Manager if you have myFMbutler's Clip Manager installed

Description:

get the layoutname or layoutid from given value.( the value can be a layoutid => than it will return the layoutname else the value is a layoutname => than it will return a layoutid )

ALSO USE CF ValuePosition !

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

This is my Custom Function and I want to edit it

Discuss:

work not (FM11)

Arthur, Bern
January 05, 2017 3:48am

Does not work here with FMPA 14

If I try to calculate a layout name from layout id I get an offsett of 55 Layouts (the calculated layout is 55 layouts ahead of the layout that should be calculated.

It seems that the list of Layout IDs are not always in the same order as the list of Layout Names.

Thomas Siebert, Hamburg
March 23, 2017 4:18am

sorry, seems that I was mistaken.

I did not realize that the Layout ID is not equal to the layout number

Thomas Siebert, Hamburg
March 23, 2017 4:47am

There are issues, when a layoutname exists more than 1x or layoutname is just a number that exists in id’s too. My suggestion is to change the function to this:

/*
• The value can be a layoutid => then it will return the layoutname else the value is a layoutname => then it will return a layoutid
• If value is found in layoutnames and in id’s then "?" is returned – this can happen, when a layoutname is only a number that exists in the id’s
• If value is not found or found more than 1x in layoutnames then "?" is returned – Avoid layoutname doublettes if you always want to go to the correct layout!
*/

SetzeVar (
[
~names = LayoutNamen ( "" ) ;
~ids = LayoutIDs ( "" ) ;
~count = ElementeAnzahl (FilterElemente ( ~names ; value )) & ¶ & ElementeAnzahl (FilterElemente ( ~ids ; value ));
~unique = HoleWert ( ~count ; 1 ) = 1 UND HoleWert ( ~count ; 2 ) = 0;
~id = HoleWert ( ~count ; 2 ) ≠ 0 UND HoleWert ( ~count ; 1 ) = 0
] ;
Falls (
~unique = Wahr ; HoleWert ( ~ids ; ValuePosition ( ~names ; value ) ) ;
~id = Wahr ; HoleWert ( ~names ; ValuePosition ( ~ids ; value ) ) ;
"?"
)
)

Udo Bösch, Bobingen, Germany
July 02, 2017 5:45pm

Sorry for a bad mistake late at night (it’s 2:49am here).
I copied the function with the German commands in my previous post.

Here it is in English:

/*
• The value can be a layoutid => then it will return the layoutname else the value is a layoutname => then it will return a layoutid
• If value is found in layoutnames and in id’s then "?" is returned – this can happen, when a layoutname is only a number that exists in the id’s
• If value is not found or found more than 1x in layoutnames then "?" is returned – Avoid layoutname doublettes if you always want to go to the correct layout!
*/

Let (
[
~names = LayoutNames ( "" ) ;
~ids = LayoutIDs ( "" ) ;
~count = ValueCount (FilterValues ( ~names ; value )) & ¶ & ValueCount (FilterValues ( ~ids ; value ));
~unique = GetValue ( ~count ; 1 ) = 1 and GetValue ( ~count ; 2 ) = 0;
~id = GetValue ( ~count ; 2 ) ≠ 0 and GetValue ( ~count ; 1 ) = 0
] ;
Case (
~unique = True ; GetValue ( ~ids ; ValuePosition ( ~names ; value ) ) ;
~id = True ; GetValue ( ~names ; ValuePosition ( ~ids ; value ) ) ;
"?"
)
)

Udo Bösch, Bobingen, Germany
July 02, 2017 5:52pm

Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:

Your Name:
City/Location:
Comment:
characters left. If you paste in more than 1500 characters, it will be truncated. Discuss the function - advertisements and other useless posts will be deleted.
Answer 9 + 5 =
Search for Custom Functions:

Custom Functions Widget
Download the Custom Function Dashboard Widget for OS X
Keep all the latest Custom Functions right at your fingertips!

Newest Custom Functions:

1. decFromHex ( hexValue )
  (Mon, Oct 16, 12:34pm)
2. MonthYearList ( startmonth ; startyear ; numbermonth ; short )
  (Mon, Oct 16, 3:38am)
3. ErrorDescription ( errorNumber )
  (Wed, Sep 27, 2:51am)
4. decodeEntities (text)
  (Wed, Sep 27, 1:22am)
5. HexidecimalToNumber ( HexidecimalValue ; counter )
  (Mon, Sep 25, 12:39pm)
6. FixedFieldConverter ( Fieldname ; f1 ; f2 ; f3 ; f4 ; f5 ; f6 ; f7 ; f8 ; f9 ; f10 ; f11 ; f12 ; f13 ; f14 ; f15 ; f16 ; f17 ; f18 ; f1
  (Fri, Sep 15, 12:34pm)
7. ShannonEntropy ( text )
  (Thu, Sep 07, 5:59am)
8. LetterCount ( text ; summary )
  (Thu, Sep 07, 5:53am)

RSS Feed of Custom Functions