cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tagustin2020
Post Prodigy
Post Prodigy

Gallery Formatting: User Names and Dates

Hello, I am in the process of creating a gallery that has quite a few columns. To make space, I would like to shorten user names to last name, firstinitial. (e.g. Agustin, T.) and I would like to shorten dates to mm/dd/yyyy (e.g. 07/28/2020).

 

My current Text property formulas for the gallery labels are:

ThisItem.Requestor.DisplayName and ThisItem.Created

 

I've attached a screenshot of what the results currently are. As you know, when you are new to Power Apps you can spend an inordinate amount of time trying to figure out very simple things so I would be very grateful for your help. Once I get good at this, I hope to help others the way you are helping newbies such as myself. Thank you to all of you who pitch in on helping us out!

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User III
Super User III

@tagustin2020 

To format the dates do this:

 

Text(ThisItem.Created, "mm/dd/yyyy")

 

To shorten the name do this...

 

With(
    {UserName: Split(ThisItem.Requestor.DisplayName, " ")},
    First(UserName).Result & " " & Left(Last(UserName).Result,1)& "."
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

4 REPLIES 4
mdevaney
Super User III
Super User III

@tagustin2020 

To format the dates do this:

 

Text(ThisItem.Created, "mm/dd/yyyy")

 

To shorten the name do this...

 

With(
    {UserName: Split(ThisItem.Requestor.DisplayName, " ")},
    First(UserName).Result & " " & Left(Last(UserName).Result,1)& "."
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Hello Matt, Thank you for your help. The date formula worked like a charm, but I am getting error messages when I enter the username formula into the Text property. I tried both copy/pasting it and manually typing it in.  I have attached screenshots of the red squigglies in the formula and the specific error messages. Is there some other step I need to take to make it work? Kind regards, Teresa

@tagustin2020 
Silly me, I forgot the SPLIT function.  Please see my post above.  I changed it to the working code.

That worked perfect. I marked it as a solution. Thank you Matt!

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (54,301)