Hello all! Hoping someone can help me figure out where the issue is in my flow.
The flow grabs data from an HTML table embedded within an email, converts it to a JSON array which is then parsed so that I can populate specific values into List entries.
I've been able to successfully convert the table and populate the values into the list, but for some reason, it is duplicating values so that instead of one new item added to the list there are four new items.
Here are the flow actions which happen once an email is received. Expression details are below
CompostTableStart - substring(triggerOutputs()?['body/body'], indexof(triggerOutputs()?['body/body'], '<table'))
ComposeTableEnd - substring(outputs('ComposeTableStart'),0,indexof(outputs('ComposeTableStart'),'</table>'))
ComposeAddCloseTableTag - output of CompostTableEnd </table>>
ComposeHTML - xml(replace(outputs('ComposeAddCloseTableTag'), '</colgroup>','</col></colgroup>'))
ComposeCountRowsMinusOne - int(xpath(outputs('ComposeHTML'), 'count(//tr)'))
SelectRowsFromHTML
- From - range(2,outputs('ComposeCountRowsMinusOne'))
- Map:
- First Name - xpath(xml(outputs('ComposeHTML')), concat('//table[1]//tr[1]/td[2]/text()'))?[0]
- Last Name - xpath(xml(outputs('ComposeHTML')), concat('//table[1]//tr[2]/td[2]/text()'))?[0]
- Phone Number - xpath(xml(outputs('ComposeHTML')), concat('//table[1]//tr[3]/td[2]/text()'))?[0]
- ZIP Code - xpath(xml(outputs('ComposeHTML')), '//table[1]//tr[4]/td[2]/text()')?[0]
Parson JSON
- Output of SelectRowsFromHTML
- Schema: {"type": "array","items": {"type": "object","properties": {"First Name": {"type": "string"},"Last Name": {"type": "string"},"Phone Number": {"type": "string"},"ZIP Code": {"type": "string"}},"required": ["First Name","Last Name","Phone Number","ZIP Code"]}}
I'm fairly certain the issue is happening somewhere in the ComposeHTML and SelectRowsFromHTML actions because I can see in the Outputs for SelectRowsFromHTML what appears to be the duplicated data:
Any thoughts for suggestions are appreciated!


Report
All responses (
Answers (