cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RomanKorchak
Helper IV
Helper IV

Select SP List column, to be updated, dynamically

Hi All

I have a SP List with a column for each month (Month1, Month2 etc.) and in the end of each month i need to update the current month column (end of Jan - update column 'Month1' and so on). But when I do Sharepoint Update Item, I get list of columns to be updated. So is there any way to select column to be updated dynamically by creating column name as a string value?

 UpdateItem.JPG

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @RomanKorchak 

 

Another option is you need to add an IF expression under each column to check which month it is and under the true condition do your updates. Yes you need 12 If expression conditions against each field.

 

Your next option is HTTP update (REST API). Here you need to dynamically construct the month1,2,3...etc. depending on the current month. Then under the body specify the column name and do the update. 

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

View solution in original post

8 REPLIES 8
abm
Super User
Super User

Hi @RomanKorchak 

 

Could you please explain bit more about what you particular column you want to update with what name?

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

I want the column, that needs to be updated, to be selected dynamically 

Hi @RomanKorchak 

 

Are you looking to update month1, month2 depending on the current month?  



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

I am looking to update column 'Month1' if its January at the moment, column 'Month2' if its February at the moment and so on.

Flow would be triggered at the end of the month and, depending of which month it is, flow would update 1 particular column.

Hi @RomanKorchak 

 

Thanks for your reply.

 

You could use utcnow('MM') to find which month is and use a Switch action step to update the relevant column.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Would not really want to write 12 Update Item actions, far not the nice solution. 

What if I had 50 columns or more?

Hi @RomanKorchak 

 

Another option is you need to add an IF expression under each column to check which month it is and under the true condition do your updates. Yes you need 12 If expression conditions against each field.

 

Your next option is HTTP update (REST API). Here you need to dynamically construct the month1,2,3...etc. depending on the current month. Then under the body specify the column name and do the update. 

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

REST API is the way to go 😃

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.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,502)