Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Custom Workflow to read Multiple Lines of text field

Posted on by 1,695

CRM 2016

I have a custom entity that i import various XML file data into.  I need to write a workflow to deal with he data, however I need to read the xml data to determine if certain keywords are there,  I suppose a simple function would be the best way, but how to read that xml data and  return the  position or just a Boolean / Bit

can anyone make any suggestion for me to look at ?

*This post is locked for comments

  • Suggested answer
    imayur Profile Picture
    imayur 630 on at
    RE: Custom Workflow to read Multiple Lines of text field

    Hi,

    You can use XDocument in custom workflow activity for XML manipulations. Linq queries can be applied on Xdocument to get the desired XML nodes to retrieve or manipulate it.

    Here are some examples of Xdocument manipulations

    Convert valid xml string  to Xdocument

    XDocument xDoc = XDocument.Parse(xml);

    Find and Assign new Value

    xDoc.Descendants("parenttag").Elements("childtag").Single().SetAttributeValue("Value", "22")

  • Pete_N Profile Picture
    Pete_N 1,695 on at
    RE: Custom Workflow to read Multiple Lines of text field

    Hey Andrew,

    Thanks for that though to be fair .. I'm still a little confused. Each of the xml files we receive has a value in the encoding which determines which type of file it is and thus I know what processing to perform.

    i was hoping that there would be a simple solution  to just call the field up and search for the value ie

    line in xml data

    ?xml version="1.0" encoding="ISO-8859-1"?

    could a 'query by attribute'  with the 'add range value' being for instance 'ISO-8859' would that work being only a partial value within the attribute ?

  • Verified answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Custom Workflow to read Multiple Lines of text field

    Hello,

    I believe XmlDocument is the way to go - stackoverflow.com/.../read-a-xml-from-a-string-and-get-some-fields-problems-reading-xml

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans