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
abm
Super User
Super User

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 blogPower 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 blogPower 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 blogPower 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 blogPower 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?

abm
Super User
Super User

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 blogPower Automate Video Tutorials

View solution in original post

REST API is the way to go 😃

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (2,010)