I am using powerapps gallery with SharePoint as the backend. I have multiselect people picker column which i am showing in gallery label. Below is the code for the same.
With(
{
wString: Concat(
ThisItem.Team_Members.DisplayName,
DisplayName & ", "
)
},
Left(
wString,
Len(wString) - 2
)
)
It was working fine for a while. However recently i noticed a weird error in app runtime. May i know what is the issue here?
If you are using the 'Formula' in the 'Label' control for your gallery, you can try:
With({name: ThisItem.DisplayName}, name & ", " & Left(name, Len(name) - 2))
But, I'm not sure if this the place that you are trying to use it.
This could happen if the second argument was negative. If ThisItem.Team_Members.DisplayName is blank then your second argument will be -2. Looks like you're using a gallery and this can happen before the gallery items have loaded.
Try this:
With(
{
wString: Concat(
ThisItem.Team_Members.DisplayName,
DisplayName & ", "
)
},
Left(
wString,
// Use max to ensure value cannot be negative
Max( 0, Len(wString) - 2)
)
)
MS.Ragavendar
27
mmbr1606
14
Super User 2025 Season 1
Michael E. Gernaey
13
Super User 2025 Season 1