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 / Single Column Transfor...
Power Apps
Answered

Single Column Transformation

(0) ShareShare
ReportReport
Posted on by

Hi,

 

I have a collection containing a single text column. I am trying to replace the first three characters of each string within the column with a blank. For example, the prefix is VV-122343-2. I would like the output to be 122343-2. I've tried the replace and substitute functions for this, combined with ForAll, but nothing seems to be working. Can someone point me in the right direction?

 

TY

Categories:
  • Rusk Profile Picture
    1,369 Super User 2024 Season 1 on at

    Hi @shuhn1229 

     

    Here's an example, where my data source is named "colTest" and the column I'm transforming is named "Value".  My new column is named "New":

     

     

    AddColumns(colTest,"New",Right(ThisRecord.Value,Len(ThisRecord.Value) - 3))

     

     

    Rusk_0-1678998336612.png

     

    To do this directly in your collection, you can try something like the following.  colTest is my data source and colNewData is my transformed data:

     

    ForAll(
     colTest,
     Collect(
     colNewData,
     {
     NewValue: Right(Value, Len(Value) - 3)
     }
     )
    )

     

    Rusk_1-1678998809229.png

     

  • shuhn1229 Profile Picture
    on at

    Thank you Rusk. This works great. Can I bug you for one more piece of advice? I was looking to use the replace function because I could replace only values containing the VV- prefix. I tried combining with an if statement and startswith below, but will not work. any thoughts?

     

    AddColumns(
     MyCollection,
     "New",
     If(
     StartsWith(
     "VV-",
     ThisRecord.Value
     ),
     Right(
     ThisRecord.Value,
     Len(ThisRecord.value) - 3
     ),
     ThisRecord.Value
     )
    )
  • Verified answer
    Rusk Profile Picture
    1,369 Super User 2024 Season 1 on at

    Try this:

    AddColumns(
     MyCollection,
     "New",
     If(
     Left(ThisRecord.Value, 3) = "VV-",
     Right(ThisRecord.Value, Len(ThisRecord.Value) - 3),
     ThisRecord.Value
     )
    )
  • shuhn1229 Profile Picture
    on at

    you the man rusk

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 345 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 225

#3
M Bilal Khan Profile Picture

M Bilal Khan 192

Last 30 days Overall leaderboard