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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Dynamics 365 Workflow Tools - String function - Trim String

(0) ShareShare
ReportReport
Posted on by 1,549

I am trying to trim (remove) the last 25 characters at the end of a string, using the Dynamics 365 Workflow Tools - String Function.

I understand that I need to use this as a 2nd step:
2020_2D00_09_2D00_29_5F00_22_2D00_37_2D00_01.jpg

But how do I specify my trimming in the first place (in the screen below)?
2020_2D00_09_2D00_29_5F00_22_2D00_37_2D00_46.jpg

Thanks!

I have the same question (0)
  • Bipin D365 Profile Picture
    28,985 Moderator on at

    Hi,

    Chech below guide to trim text in workflow.

    github.com/.../String Functions.md

    Please mark my answer verified if i were helpful

  • erhan.keskin Profile Picture
    2,253 on at

    Hi,

    I think what you need is SubString rather than Trimmed Text.

    This is what you can do;

    If you have an exact length of the text from left to right, then you can provide them like;

    • Substring: From Left to Right = True
    • Substring: Start Index = 0
    • Substring: Length = [The Length of the text you want]
    • Use "SubString Text" from output

    If you don't have an exact length of a text from left to right, then you can provide them like;

    • Use "TextLength" from output to determine the length of your text (Title {note}) first
    • Then use subtring properties
      • Substring: From Left to Right = True
      • Substring: Start Index = 0
      • Substring: Length = [TextLength from the first step - 25]
    • Use "Substring Text" from output

    Regards,

  • yleclerc Profile Picture
    1,549 on at

    @Bipin - Thank you for taking the time to answer. But this page does not help. The instructions are incomplete, which is why I need some help.

  • Suggested answer
    yleclerc Profile Picture
    1,549 on at

    Thanks Erhan!

    I don't have an exact length for all records, si I need to go with your 2nd suggestion.

    It makes a lot of sense! But in the last part, I can't seem to be able to insert a calculation in this field: Substring: Length

    Once I insert the Lenght that I got in the first step, I can't type in the field any more (to remove 25 from that length).

    2020_2D00_09_2D00_30_5F00_09_2D00_05_2D00_51.jpg

  • yleclerc Profile Picture
    1,549 on at

    I also tried with this regular expression: (.{25}$)

    But it keeps the last 25, and I want to remove them :(.

  • erhan.keskin Profile Picture
    2,253 on at

    Can you check if you can select "Decrement By" operator in that whole number field? If so, try it please.

    pastedimage1601473478362v1.png

  • yleclerc Profile Picture
    1,549 on at

    Yep! I tried this too, but the "Operator" field is greyed out.

  • yleclerc Profile Picture
    1,549 on at

    Oh well, I finally figured it out. It's not perfect, but it works.

    1. Isolate the last 25 characters in a sting using Regular Expression.
    6708.jpg

    2. Replace the isolated string by... nothing
    4606.jpg

    3. Use "Replaced Text" when updating the field.

  • MJatAU Profile Picture
    10 on at

     I would like to remove all spaces from a concatenated address but the Output Parameter 'Without Spaces' is not available. Is there a different way to remove all spaces?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
11manish Profile Picture

11manish 99

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 78 Super User 2026 Season 1

#3
Martin Dráb Profile Picture

Martin Dráb 59 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans