Parsing Key Value Pairs | Community
Skip to main content
Level 5
May 13, 2025
Solved

Parsing Key Value Pairs

  • May 13, 2025
  • 1 reply
  • 426 views

We have a flow that is parsing text from an Outlook Email using the HTML to Text parser which works fine, then taking that and using the Get Elements from Text module with Key Value Pairs.  This is spliiting up the body correctly except in cases where the title uses special characters.  The item below would read in as Multidisciplinary Center and drop everyting after the special character occurs.  What do I need to do to get it to read the special characters? Multidisciplinary Center (MDC) Medical History

 

 

Item Name: Multidisciplinary Center (MDC) Medical History

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Sven-iX

Hi @stacey_robertson 
I'd create a ticket - that seems off they chop off the value portion due to a "("

 

Meantime, roll your own with a regular expression (Match Pattern module)

IF all your key-value pairs are on separate lines: 

^(\w[^\n\r:]+:\w.+?)$

[ \w = a-z and A-Z and 0-9 and _ (underscore) ]

 

That'll spit out all the matches as separate bundles.

Make sure to check Global Match and Multi-line boxes

 

In English, this looks for lines that

  • start with one char that is  a-z or A-Z or 0-9 or _
  • and followed by anything that is not a line feed, carriage return or ":" 
  • followed by colon (key:val separator)
  • followed by one char that is  a-z or A-Z or 0-9 or _
  • and followed by any character until end of line

[ Note in theory we shouldn't need to check for preceding line feeds and carriage returns but apparently this module also has a bug! ]

 

This allows for spaces and other "special" characters in key or value.

1 reply

Sven-iX
Community Advisor
Sven-iXCommunity AdvisorAccepted solution
Community Advisor
May 13, 2025

Hi @stacey_robertson 
I'd create a ticket - that seems off they chop off the value portion due to a "("

 

Meantime, roll your own with a regular expression (Match Pattern module)

IF all your key-value pairs are on separate lines: 

^(\w[^\n\r:]+:\w.+?)$

[ \w = a-z and A-Z and 0-9 and _ (underscore) ]

 

That'll spit out all the matches as separate bundles.

Make sure to check Global Match and Multi-line boxes

 

In English, this looks for lines that

  • start with one char that is  a-z or A-Z or 0-9 or _
  • and followed by anything that is not a line feed, carriage return or ":" 
  • followed by colon (key:val separator)
  • followed by one char that is  a-z or A-Z or 0-9 or _
  • and followed by any character until end of line

[ Note in theory we shouldn't need to check for preceding line feeds and carriage returns but apparently this module also has a bug! ]

 

This allows for spaces and other "special" characters in key or value.