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.

Conditional formatting not working in header

Featured Replies

I've got a list layout which allows a user to view a parts stock forecast over a 13 week period, which makes use of conditional formatting to highlight certain aspects of the data.  

 

The body of the list consists of 13 separate calculated fields which represent the stock on hand each week; these are called _cWeek01 through to _cWeek13

 

In the header I have a global repeating numeric field with 13 repetitions; I recalculate the week number based n the current date as needed so, for example, the first rep would contain the week of year for Monday 7th January 2013 (2) and the last rep would contain the value of 14, to represent week of year 14.   Call this _gHeader

 

At the bottom of the layout I have a global numeric variable which contains a value to represent one of the weeks in the current 13 week period - call this _gWeek

 

In the body, I have set conditional formatting on the individual stock on hand fields so that, for example, _cWeek01 would have the conditional test _gWeek = _gHeader[1] and _cWeek13 has the test _gWeek = _gHeader[13].  When the condition is true the field fills pink.  So as the value of _gWeek is changed, the result is a highlighted column in the list.

 

The problem is that if I apply the same conditional formatting to the _gHeader field (which is in the header not the body), it only works for the first repetition, even when the 13 repetitions are displayed individually.

 

You can see this in the two jgp images attached - in week 53, _gweek is set to 53.  post-53652-0-47325300-1357300652_thumb.j

 

In week 2, _gweek is set to 2. post-53652-0-25503800-1357300669_thumb.j

 

The formatting works in the body but not on the header.

 

Any ideas, or is this simply not possible to do?

 

Thanks

 

Brian

 

 

At the bottom of the layout I have a global numeric variable which contains a value to represent one of the weeks in the current 13 week period - call this _gWeek

 

I presume you mean a field, not a variable?

 

 

 

if I apply the same conditional formatting to the _gHeader field (which is in the header not the body), it only works for the first repetition,

 

What is the exact formula used in the conditional formatting? I believe that =

Self = _gWeek

should work for all repetitions.

  • Author

Apologies, yes _gWeek is a global field, not a variable

 

I decided to build a separate test database to test out the problem, and it worked as expected.  When I compared the two databases I realised that _gWeek was defined as a repeating global field_gWeek[30].  When I changed this for another global which was not defined with repetitions, the conditional formatting worked correctly. 

 

So this seems to suggest that conditional fomatting doesn't work as expected if the conditional test depends on two global repeating fields

 

See attached sample database attached  (FMP11)

 

Brian

Conditional Formatting and Repeating Globals.zip

  • Author

Thanks @comment

 

Should there have been a link or an attachment?

 

Brian

Yes.

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.