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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Extract specific line from Multiple Lines of Text and copy to another field

(0) ShareShare
ReportReport
Posted on by 3,070

Hi guys,

I was wondering if it is possible to identify a specific line within a Multiple Lines of Text field and copy the value to a seperate field?

In my organisation, we have Leads created from our Online Shop using a Zapier plugin.  One of the fields that is created copies all of the Line Item data from our shop to our CRM system in a Multiple Lines of Text field.  I would like to extract a specific line from this field and copy it to another field.

The data that is generated is as follows:

categories: XXXXX
item_meta: []
line_subtotal: 0.00
line_subtotal_tax: 0.00
line_tax: 0.00
line_total: 0.00
name: Product Name
product_id: 25101
quantity: 1
sku: HSE02
tags:
tax_class:
type: line_item
variation_id: 0

I would like to take the data from the line that begins "Name:" as this is the specific product that is being purchased and I'd like to make it easier for my users to find.

I hope this makes sense...

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    Have you considered usage of regular expressions like:

               var sourceString = @"categories: XXXXX

    item_meta: []

    line_subtotal: 0.00

    line_subtotal_tax: 0.00

    line_tax: 0.00

    line_total: 0.00

    name: Product Name

    product_id: 25101

    quantity: 1

    sku: HSE02

    tags:

    tax_class:

    type: line_item

    variation_id: 0";

               Regex regex = new Regex("name: (.*)\r\n");

               var v = regex.Match(sourceString);

               string s = v.Groups[1].ToString();//should be 'Product Name'

  • Ryan Maclean Profile Picture
    3,070 on at

    Hi Andrii,

    I was hoping for a no-code solution ideally.  I'm not particularly adept at jscript and I'd like to make it easy to maintain going forward.  

    Frustratingly I can achieve this easily in Excel with a combination of MID and FIND functions.  I've looked at North52's BPA solution and I think it might work, if I can figure out the logic

  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    You can use this pack of custom workflow activities - jlattimer.blogspot.com/.../crm-string-workflow-utilities.html

    It contains mentioned Regular Expression.

  • Verified answer
    Ryan Maclean Profile Picture
    3,070 on at

    For anyone else reading this, I managed to accomplish what I was looking for by using the Business Process Activities Formula Manager from North 52 (www.north52.com/.../formula-manager-for-microsoft-dynamics-crm-xrm).  This allowed me to turn an Excel formula into a function on CRM relatively easily.

    I'm sure this could have been accomplished with jscript or using a number of custom workflow activities, but this was the simplest method for my specific situation

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans