cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
abc1235
Frequent Visitor

Update each column based on results - Power automate

Been trying to separate each results of the html_to_text and add them to the correct column in Excel. 
However, if I do the apply to each, it updates each rows and columns with the same data.

Here's my current flow. I've removed the apply to each for now. 

PA1.PNG

Here's the format of data. I'm able to extract them without issues. I just can't tranpose them to their specific columns in a blank excel worksheet table.

Alert triggered for SomeAlert
Alert ID: 12345678
Test Name: SomeValue1
Alert Rule: SomeValue2
AlertsTest | Oct 21st

Any suggestions please? 

5 REPLIES 5
grantjenkins
Community Champion
Community Champion

What's the actual output you want in each row?

 

grantjenkins_2-1666700692661.png

 

OR

 

grantjenkins_1-1666700519504.png

 

OR other?

 

Also, what do you currently have in your Add a row into a table that's not currently working?

 

And will it always return exactly 5 items, or could there be more/less?

 



----------------------------------------------------------------------

If I've answered your question, please mark the post as Solved.

If you like my response, please consider giving it a Thumbs Up.

The second output. 

Currently, I don't have any config on the "Add a row into a table" since if I put item() on each column, it won't return the value I want. Any suggestions?

It won't return exactly just 5 items, it has more. (240 records to be exact) but has the same format.

grantjenkins
Community Champion
Community Champion

I'll see what I can come up with today.

 

Just a few more questions to make sure I get what you want:

  1. Do all the ~240 column headers already exist in the blank table?
  2. Will it always return exactly 240 items?
  3. Will they always be in the same order?
  4. If same order, will the order match the headers in the table?
    • First item returned goes in column A
    • Second item returned goes in column B
    • Etc.

 

Note:

  • Some of the data (first item) just has text and doesn't need to be split.
  • The next three items need to be split by colon :
  • The last item needs to be split by pipe |

Are there any other variations with regards to how the headers / data are returned (other than : or |)?



----------------------------------------------------------------------

If I've answered your question, please mark the post as Solved.

If you like my response, please consider giving it a Thumbs Up.

1. yes, it does
2. no, it will not.
3. yes, they will always be in the same order
4. yes, i made sure they have the same name

No other variations other than what's in the format.

abc1235
Frequent Visitor

Update: Was able to add the following setup on the "Add a row into a table" and it gives me what I wanted but it includes additional text in them. And this one uses body('Html_to_text'). My issue with that is, if it's not filtered via filter array, then it will not have the below format: 
Alert triggered for SomeAlert
Alert ID: 12345678
Test Name: SomeValue1
Alert Rule: SomeValue2
AlertsTest | Oct 21st

How do I get the output of the filter array and reference them to the expressions below? I tried using "outputs" but keep getting errors. 

PA2.PNG

#for alert triggered
first(skip(split(first(split(body('Html_to_text'),'Alert ID')),'Alert Triggered'),1))

#for alert cleared # should be separate
first(skip(split(first(split(body('Html_to_text'),'Alert ID')),'Alert Cleared'),1))

#for the alert id
first(skip(split(first(split(body('Html_to_text'),'Test Name')),':'),1))

#for the test name
first(skip(split(first(split(body('Html_to_text'),'Alert Rule')),'Test Name:'),1))

#for alert rule
first(skip(split(first(split(body('Html_to_text'),'Date')),'Alert Rule:'),1))

#for date
first(skip(split(body('Html_to_text'),'Date'),1))

Raw results below. 
PA3.PNG
 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (5,361)