cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Working with extracted XML - Parsing out & concatenating back together

Jump to solution

This question is a follow-up to a previous question on how to pull out xml data for a multi-line text with using append changes to text.  I have been able to create a workflow which will pull the xml data, but the data is still kind of messy.  I want to continue building onto my workflow to  take this data, strip out the non-needed text, concatenate the outputs back together and store results in another field.  I know to concatenate the fields back together I need to use Build String, but I'm not sure what to use when stripping out the unneeded text.

Again, the method I'm using (multi-line append changes to text field) is required per my line of work.  I need to pull the data out and load into another field for easy extraction into excel.

Below are the results of my Query XML step.  I have 3 outputs which will need to be 'prettied-up' and then concatenated back together before loading into another field.

Any help would be greatly appreciated! 

Labels: (1)
0 Kudos
Reply
15 Replies
Workflow Hero

Re: Working with extracted XML - Parsing out & concatenating back together

Jump to solution

I guess you mean toclear  HTML markups from output3 of your screenshot...

and I assume you stored output3 into a collection variable.

then actually you do not need to split&put together anything. you can remove all the markups with single regular expression operation

use regexp pattern like 

(<div class="ExternalClass[0-9A-F]+">|</div>|<p>|</p>)

note output of a regular expression action is a text. if you need to turn it back into a collection, use one another regular expression action to split text by semicolons into a collection

use simple regexp pattern like 

;

0 Kudos
Reply
Workflow Hero

Re: Working with extracted XML - Parsing out & concatenating back together

Jump to solution

Good Morning Marian,

Thank you so much!!!  That is super helpful!!!  I also need to strip out the extra text in Output2, so only the user's name is left.  Currently, Output 2 displays UserName, system ID, user email address, UserName.  I only need the User's name (once).  What is the easiest way to strip out all the other data and just leave the text inside the Red circle in my screen print below?

Thank you!

0 Kudos
Reply
Workflow Hero

Re: Working with extracted XML - Parsing out & concatenating back together

Jump to solution

try with following regular expression 

\d+.*?,#,#
0 Kudos
Reply
Workflow Hero

Re: Working with extracted XML - Parsing out & concatenating back together

Jump to solution

Hi Marian,

Sorry I did not respond for a bit, got pushed onto another project that took precedence.  Back to getting this resolved now.

I added in the last expression you sent to break out the Editor.  It is working, but I am left with an extra comma inbetween the last and first name: lastname,, firstnameIs there a way to be able to remove the extra comma?

Additionally, I am able to confirm the text is being broken out appropriately as well!

Thank you!!

Christine

0 Kudos
Reply
Workflow Hero

Re: Working with extracted XML - Parsing out & concatenating back together

Jump to solution

I don't see this in my env. don't you have that commas originally in your user names?

either way, you can remove commas with an extra regular expression action, or build string action with replace() function.

0 Kudos
Reply
Workflow Hero

Re: Working with extracted XML - Parsing out & concatenating back together

Jump to solution

our user names are separted in our system by 1 comma, but when extracting the data out, there are 2 commas.

What is the format for the regular expression action that will remove one of the commas?  I tried it on my own, but I was not successful.

Thank you.

0 Kudos
Reply
Workflow Hero

Re: Working with extracted XML - Parsing out & concatenating back together

Jump to solution

Hi Marian,

Is there an expression to change the format of the date/time?  My date/time is coming out like this: 2018-06-18T18:18:40Z

Is there a way to change the time format to be 12hr format w/ AM/PM? 

Thank you!!

0 Kudos
Reply
Workflow Hero

Re: Working with extracted XML - Parsing out & concatenating back together

Jump to solution

simply replace doubled commas with single one

Reply
Workflow Hero

Re: Working with extracted XML - Parsing out & concatenating back together

Jump to solution

what would you like to do with the date?

most of the actions/controls will accept it in this way

0 Kudos
Reply