How to Use For Each List Item Activity

Good morning,

I am using the For Each List Item activity to scroll through a Sharepoint list, however I am having difficulty accessing the list items. For each item I need to get the value from the “Apólice” column, perform some actions and at the end update the “Progresso” column of this current item to the “Em contato” value, using the Update List Item activity. Can anyone help me by providing a way to do this?


@marilia_quadros

In the loop use this in assign

Listitem.Where(function(x) x.Name.Equals("ColumnName"))(0).Value = "Required Value to be updated"

Then in the update list item pass the listitem

Cheers

Thank you for your availability to help me. The ListItem variable is of type Office365SharepointListItem

@marilia_quadros

A small correction

Listitem.Fields.Where(function(x) x.Name.Equals("ColumnName"))(0).Value = "Required Value to be updated"

I have missed fields

Cheers

Perfect, I’ll test it here.
I would like to ask two more questions.
1st This filter from the For Each activity, how you want the information to be placed. I want to only cycle through items where the “Progresso” column = “Não iniciado”?
image 5

2nd How to put the content of the current item in the “Apólice” column in the NumberApolice variable?
image4

It would help me a lot to know these questions

@marilia_quadros

Use like this to filter "fields/Progresso eq 'Whatever Value you need'"

For getting value

variablename = Listitem.Fields.Where(function(x) x.Name.Equals("ColumnName"))(0).Value

Cheers

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.