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.

Hide calculation on portal field help

Featured Replies

  • Newbies

Hi, I am trying to hide a field in a portal using a calculation on the "hide" behaviour.

Based on this article from some versions back - https://www.teamdf.com/blogs/a-very-nice-way-to-format-a-sorted-portal-using-conditional-formatting/. However, I am trying to use Global Variables to achieve this.

In short, my portal has a "category" field whose value is repeated. And I want to "GroupBy" it, and only show the first occurrence of the category and hide the subsequent ones.

<category> <name> <description>

Cat1 ... ...

Cat1 ... ... << Hide Cat1

Cat2 ... ...

Cat2 ... ... << Hide Cat 2

 

I tried to hide the <category> field using the behaviour with the following calculation:

Let([ 
This = Category::Name ; 
$$Prev = $$NextPrev ;
$$NextPrev = This
] ;
$$Prev = This

)

I keep $$Prev as the previous category value, so that if the current "This" field is the same, I attempt to hide it.

This will hide all the <category> because presumably $$Prev = This.

 

However, If I test

a. $$Prev = "Cat1"

b. This = "Cat1" 

"Cat1" gets hidden.

I am just wondering if there's something wrong with my calculation?

Thanks in advance!

 

 

 

 

 

I haven't tested your attempt because IMHO, this method of cascade-overwriting of variables is not robust enough even when implemented "correctly". I would prefer using a calculation field, as shown here:
http://fmforums.com/forums/topic/54781-getting-a-value-from-previous-portal-row/#comment-258830

---
ADDED:
BTW, the article that you point to does NOT use global variables - and it too requires a calculation field to be defined in the child table.

 

 

Edited by comment

  • Author
  • Newbies

Thanks for the tip! I looked at your example, from the link and used a unstored calculation instead. 

Thanks

 

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

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.