cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kultaev
Regular Visitor

Update text column in array of items selected from SharePoint list

I have build flow which is doing following:

 

1. Get items (retrieve needed records with OData filter from source sharepoint list)

2. Select (get from step 1 only several needed columns)

3. Apply to each

here I try to loop through items and update Comments Log field with following expression.

replace(item()?['Comments Log'], item()?['Comments Log'], substring(item()?['Comments Log'],0,150))
I expected that it would reduce text in array created at step 2 to have only first symbols in the text.

 

4. Create HTML table, here I am trying create HTML table that I can later submit to email. However I cannot select output of step 3, only step 2 which gives me not modified column for Comments text.

 

Please share idea how I can get expected result, to have table with one field reduced to first 150 characters

1 ACCEPTED SOLUTION

Accepted Solutions
tom_riha
Super User II
Super User II

Hello @kultaev ,

if you want to take some data that's produced inside 'Apply to each' outside, you must store it into a variable. Otherwise the dynamic content stays and is available only inside that 'Apply to each'.

Or you can move the rest of the flow inside that 'Apply to each', but I don't think that's what you want to do.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

2 REPLIES 2
tom_riha
Super User II
Super User II

Hello @kultaev ,

if you want to take some data that's produced inside 'Apply to each' outside, you must store it into a variable. Otherwise the dynamic content stays and is available only inside that 'Apply to each'.

Or you can move the rest of the flow inside that 'Apply to each', but I don't think that's what you want to do.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

kultaev
Regular Visitor

Thank you for suggestion @tom_riha !

 

Following that I have made it work. I ended up initializing blank Array variable, and then in the loop through Select output populated this Array line by line with item()?['field_name'] for all other fields than reduced comments field and for reduced comment field via separate Compose expression. Finally I was able to feed Create HTML table step with this constructed array where length of the Comments column was reduced!

 

screenshot.png

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (19,951)