Hello everyone. Trying to parse a value from a delimited name value pair, using principally the substring and indexof functions.
Here's the shortened text string: (there's about 30 name/value pair variations in total
Lastname:ValueIs123|
Firstname:ValueIs456|
and using this, when only the "Lastname:ValueIs123|" is in the text blob is fine, but fails when I add the second name/value pair because the pipe is no longer unique. I cannot rely on other suppliers to meet an XML syntax format because they currently use colon delimiter for the defined name property and pipe delimiter for the end of the value.
How do I do this, to intruct the expression to look for the next occurence of pipe based upon a defined start point (indexof)??
substring(triggerBody()['text'],(add(indexof(triggerBody()['text'],'Lastname:')),9),(sub(indexof(triggerBody()['text'],'|'),(add(indexof(triggerBody()['text'],'Lastname:')),9)))
----------------
If I use XML syntax name/value pairs to prove it works.
substring(triggerBody()['text'],add(indexof(triggerBody()['text'],'<Lastname>'),10),sub(indexof(triggerBody()['text'],'</Lastname>'),add(indexof(triggerBody()['text'],'<Lastname>'),10))) substring(triggerBody()['text'],add(indexof(triggerBody()['text'],'<Firstname>'),11),sub(indexof(triggerBody()['text'],'</Firstname>'),add(indexof(triggerBody()['text'],'<Firstname>'),11)))
against array
<Lastname>Alpro</Lastname>
<Firstname>No-latte</Firstname>
I get:
"subject": "Alpro",
"notetext": "No-latte",
Hi @rjd2703
Depending on what it is you need to use the values for later in your Flow, you may be able to make use of the Split expression.
{ "type": "object", "properties": { "items": { "type": "array", "items": { "type": "string" } } } }
Michael E. Gernaey
497
Super User 2025 Season 1
David_MA
436
Super User 2025 Season 1
Riyaz_riz11
244
Super User 2025 Season 1