SOLVED

When formatting gallery view can you make items that appear on the card change based column value?

Copper Contributor

I would like to have a gallery view that is grouped by a status value such as: "requested" "in work" "complete" and I would like the information displayed on the card to change based on this status.  this is to not clog the cards up with information that isnt relevant at that stage. i would prefer this to remain in the same view too

 

thank you 

8 Replies

@LukeJSmith Yes, you can do it using "Advanced mode" in Gallery view formatting setings.

 

Check below documentations for more information:

  1. Gallery layout customizations 
  2. Group customization syntax reference 

Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

Hi there, thank you for your response. I have done some gallery layout customizations through the advanced mode already, i cant quite see how to implement the "group customization syntax reference". Thank you

@LukeJSmith You can apply grouping on list views from list view settings. Check: Use grouping to modify a list or library view 


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

so i already know how to group and i know how to format but how do you format based on what group something is in?
best response confirmed by LukeJSmith (Copper Contributor)
Solution

@LukeJSmith You can get the grouped column value in JSON using: 

 

@group.fieldData

 

Then you can show/hide elements based on column value like: 

 

"style": {
    "display": "=if(@group.fieldData == 'Requested', 'inherit', 'none')"
}

 

This will show element if column value is equal to "Requested" else hide an element.


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

This was great and worked well.

I was wondering if there was a way to dynamically change the size of a card? As I am hiding and showing information sometimes it doesn't all fit and sometimes there is a large blank space at the bottom of the card. do you have a way to make the card container larger and smaller based on how much information there is?

@LukeJSmith I am not sure if you can make it dynamic automatically based on its content. But, you can write conditional formulas for width and height as well. 

For example: 

 

"width": "=if([$Department] == 'No1', 500px, if([$Department] == 'No2', 200px, if([$Department] == 'No3', 350px, '1000px')))",

So, you might need to add such conditions and fixed width/height based on column showing/hiding.

 


Please consider giving a Like if my post helped you in any way.

1 best response

Accepted Solutions
best response confirmed by LukeJSmith (Copper Contributor)
Solution

@LukeJSmith You can get the grouped column value in JSON using: 

 

@group.fieldData

 

Then you can show/hide elements based on column value like: 

 

"style": {
    "display": "=if(@group.fieldData == 'Requested', 'inherit', 'none')"
}

 

This will show element if column value is equal to "Requested" else hide an element.


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

View solution in original post