web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to use ShowColumns...
Power Apps
Answered

How to use ShowColumns with a Right(,) ?

(0) ShareShare
ReportReport
Posted on by 829

Hi FOlks -


I have the following collection:

 ClearCollect(
 TargetList,
 {
 TargetAlias: "Not Applicable",
 TargetID: "Not Applicable"
 },
 ShowColumns(
 Filter(
 rdTarget,
 Or(
 Not(DataElement_Type.Value = "Time Tracking"),
 Not(Portfolio_Status.Value = "Terminated")
 )
 ),
 "TargetAlias",
 "TargetID",
 "DDU_Portfolio",
 "Modality_Detail",
 "Target_Short_Name",
 "Target_Long_Name",
 "Business_Owner",
 "Mechanism",
 "IP_Owner"
 )
 )

 

But for the "TargetID", I actually want to do:

Right(TargetID,8)

 

How would I achieve that? Thanks!

Categories:
  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @simms7400 

    You could use AddColumns() to add the truncated ID column.  

     

    ClearCollect(
     TargetList,
     {
     TargetAlias: "Not Applicable",
     TargetID: "Not Applicable"
     },
     ShowColumns(
     AddColumns(
     Filter(
     rdTarget,
     Or(
     Not(DataElement_Type.Value = "Time Tracking"),
     Not(Portfolio_Status.Value = "Terminated")
     )
     ),
     "RtargetID",Right(TargetID,8)
     ),
     "TargetAlias",
     "TargetID",
     "RtargetID",
     "DDU_Portfolio",
     "Modality_Detail",
     "Target_Short_Name",
     "Target_Long_Name",
     "Business_Owner",
     "Mechanism",
     "IP_Owner"
     )
     )

     

     In this formula, the truncated column is added within the ShowColumns() function but not replacing the TargetID. However, it could replace TargetID by leaving that one out of the ShowColumns() list and renaming RtargetID to TargetID for the collection. 

  • simms7400 Profile Picture
    829 on at

    @Drrickryp 

     

    Thank you so much, this worked like a charm!!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 352 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 323

#3
Mohsin Ali Profile Picture

Mohsin Ali 226

Last 30 days Overall leaderboard