How to parse name:value pairs in inbound mail Flows

Stefan Reichelt
Tera Guru
Tera Guru

Hi all,

 

I've seen posts from the past, but maybe something changed in the meantime: Are there any new solutions for parsing name:value pairs in inbound mail bodies which are supposed to be handled by an inbound mail triggered Flow instead of a classic Inbound Action?

 

Best regards

1 ACCEPTED SOLUTION

Stefan Reichelt
Tera Guru
Tera Guru

Thanks a lot for helpful answers. Eventually, I solved it using a custom action which can parse any input dynamically.

Snippet:

var reg = inputs.bodyText.split(/\r\n|\r|\n/); // reg becomes an array. 
var parsedObj = {};//split into 2d array
for(var i=0;i<reg.length;i++){
  reg[i] = reg[i].split(":");
  parsedObj[reg[i][0]]=reg[i][1];    
 }

It returns an object where I can access any of the parameters with a simple dot walking because the key is also the name of the parameter.

View solution in original post

5 REPLIES 5

Stefan Reichelt
Tera Guru
Tera Guru

Thanks a lot for helpful answers. Eventually, I solved it using a custom action which can parse any input dynamically.

Snippet:

var reg = inputs.bodyText.split(/\r\n|\r|\n/); // reg becomes an array. 
var parsedObj = {};//split into 2d array
for(var i=0;i<reg.length;i++){
  reg[i] = reg[i].split(":");
  parsedObj[reg[i][0]]=reg[i][1];    
 }

It returns an object where I can access any of the parameters with a simple dot walking because the key is also the name of the parameter.