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.

List ( calculation )

Featured Replies

Hi all friends

I have a problem with the List( ) function of FM 8.5.

The help on line says:

List function

Format

List(field{;field...})

Parameter

field - any related field, repeating field, or [color:red]set of non-repeating fields; [color:red]or an expression that returns a field, repeating field, or [color:red]set of non-repeating fields.

So, if I have a field (FieldContents) with a calc like this:

Let([

fieldNames = Substitute ( ¶ & FieldNames ( Get(FileName) ; Get(LayoutName) ) & ¶ ;["FieldContents¶";""]; [¶ ; " ; "] );

adjustedFieldNames = Middle ( fieldNames ; 4 ; Length ( fieldNames ) - 6 )

];

list ( adjustedFieldNames )

)

I think that i'll have all the field contents of a given record...but NO ! Can someone say me why ?

The function doesn't take field-names, it takes real fields. If you have fields A and B, you can use List with a calculation of:

  List ( If ( IsEmpty©; A; B ) )

I think what it means for the set is that you can specify as many as you like (but explicitly):P

  List(A,B,C,D,E)

Hope this helps.

  • Author

Hi

so what is the difference from:

set of non-repeating fields ( like: List(A;B;C;D;E) )

&

an expression that returns a set of non-repeating fields

( the above calculation is an expression that returns a set of non-repeating fields )

??

Can someone give me a working example of List( ) using as parameter an expression that returns a set of fields ?

Hi Daniele - I think you're missing the point. Your parameter, adjustedFieldNames, evaluates to a text string - not a field reference. So at the end you have List ( "A ; B ; C ; D" ). Try using GetField() or Evaluate() to turn the text string/s into field reference/s.

  • Author

Hi comment

just do it !

This seems to work, as unstored calc:

Let([

fieldNames = Substitute ( FieldNames ( Get ( FileName ) ; Get ( LayoutName ) ) & ¶ ; [ "fieldContents¶" ; "" ] ; [ ¶ ; " ; " ] );

listFieldNames = "List ( " & Middle ( fieldNames ; 1 ; Length ( fieldNames ) - 3 ) & " )"

];

Evaluate ( listFieldNames )

)

BTW: the question remains: Can you give me a working example of List( ) using as parameter an expression that returns a set of fields ? ( as the help on line says )

I think that:

GetField ( "fieldName1" ) ; GetField ( "fieldName2" ) ; GetField ( "fieldName3" )

qualifies as an expression?

  • Author

Huuu !

Isn't more simple, if we know the fieldNames, to write:

List ( A ; B ; C )

and not

List ( GetField ( "A" ) ; GetField ( "B" ) ; GetField ( "C" ) )

??

Well, yes, but it's just an example - the text expression could come from another expression, for instance:

GetField ( gSelectField1 ) ; GetField ( gSelectField2 ) ; GetField ( gSelectField3 )

or, closer to your original problem:

GetField ( MiddleValues (...) )

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.