Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum
Suggested answer

Dynamics 365 Workflow Tools - String function - Trim String

Posted on by 1,545

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!

  • MJatAU Profile Picture
    MJatAU 10 on at
    RE: Dynamics 365 Workflow Tools - String function - Trim String

     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?

  • yleclerc Profile Picture
    yleclerc 1,545 on at
    RE: Dynamics 365 Workflow Tools - String function - Trim String

    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.

  • yleclerc Profile Picture
    yleclerc 1,545 on at
    RE: Dynamics 365 Workflow Tools - String function - Trim String

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

  • erhan.keskin Profile Picture
    erhan.keskin 2,247 on at
    RE: Dynamics 365 Workflow Tools - String function - Trim String

    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
    yleclerc 1,545 on at
    RE: Dynamics 365 Workflow Tools - String function - Trim String

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

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

  • Suggested answer
    yleclerc Profile Picture
    yleclerc 1,545 on at
    RE: Dynamics 365 Workflow Tools - String function - Trim String

    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
    yleclerc 1,545 on at
    RE: Dynamics 365 Workflow Tools - String function - Trim String

    @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.

  • erhan.keskin Profile Picture
    erhan.keskin 2,247 on at
    RE: Dynamics 365 Workflow Tools - String function - Trim String

    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,

  • Bipin D365 Profile Picture
    Bipin D365 28,962 Moderator on at
    RE: Dynamics 365 Workflow Tools - String function - Trim String

    Hi,

    Chech below guide to trim text in workflow.

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

    Please mark my answer verified if i were helpful

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,558 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,647 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans