This sample provides rounded images for each person in a multi-select person field.
The sample demonstrates the use of the
forEach property to apply a format for each value of an array (multi-select person fields). Additionally, the
loopIndex operator is used in conjunction with the
length operator to ensure that regardless of how many persons are selected the field doesn't run over. This style of profile pictures with a descriptive overflow is often called a facepile
User Profile Picture sizes
The L size profile pictures maintain the ratio of the original photo which means they are not guaranteed to be square. Neither are they guaranteed to be 300px wide. The maximum width will be 300px but if the original image was smaller than that, then it will be the original size. Even the placeholder image for the L size is only 250x150.
Overall, however, the L size shouldn't be used inside columns not only because the ratio is not guaranteed, but because the default column width won't allow you to take up that much space.
@currentField.picturecan be used to retrieve a profile picture directly from a person column. However, size options are not available using that approach.
- This format can be applied to a Multi-Select Person column
|1.0||April 4, 2019||Initial release|
THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
A format geared toward providing a rounded image for single person fields can be found here: person-roundimage-format