Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Concatenate string and field and update another field

Posted on by

Hi,

I have a custom entity that needs to hold a URL to a pdf document in sharepoint.
The entity has a field that holds the document name that is used in the path.

The URL will be created in the following format: "sharepoint path/" + [Custom Entity Field] + ".PDF"

Can this be done by using a business process flow or do I need a plugin for this type of thing?

*This post is locked for comments

  • yleclerc Profile Picture
    yleclerc 1,545 on at
    RE: Concatenate string and field and update another field

    Very nice post. Quick question though. What if the string I need to concatenate has double quotes in it? How can I isolate those?

  • Suggested answer
    monty270311 Profile Picture
    monty270311 on at
    RE: Concatenate string and field and update another field

    Thanks! That makes perfect sense.

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Concatenate string and field and update another field

    This can be achieve in multiple ways so you can choose what fits your need best. You can use the workflows to set the desired field value. In the example below I created a sync workflow which is fired when the account record is created or the account name is updated and used that to populate the website field using slugs and string concatenation.

    3324.WorkFlow.png

    This will update the account field on the server whenever the account name is updated or new account is created. This will trigger on data import and SDK endpoints too. However on the client the change is not immediately visible .

    In order to achieve that you can use client API to do the same on the client. See example here - https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/clientapi/clientapi-form-context

    In short on change on the account name -> get the field value and set the desired field after decorating with the sharepoint substrings.

     

  • Verified answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: Concatenate string and field and update another field

    Hello,

    As suggested above calculated field will be the best options for you. You don't need to write any code , just to make sure you are concatenate correct fields.

    Check here for more details -

    crmramblingsbysteven.wordpress.com/.../microsoft-crm-2015-how-do-i-concatenate-two-fields-in-microsoft-crm-2015-revised

  • Verified answer
    gole1296 Profile Picture
    gole1296 115 on at
    RE: Concatenate string and field and update another field

    Sounds to me like a calculated text field will get you exactly what you need. Go to the entity, and create a new field:

    Data Type - Single Line of Text

    Field Type - Calculated

    Format - URL

    On the Calculated field menu, you can build your URL piece by piece.

    Field = CONCAT(<sharepoint path>, <Document Name>, ".PDF")

    That should build it out for you just fine. You can use values from fields on the entity, or by typing in a manual value (like ".PDF") to build the string. Make sure your manually entered string is in quotes.

    calculated-URL.PNG

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans