In this Power Automate tutorial, we will discuss how to update the SharePoint list increment integer field using Microsoft Flow.
We will see an example of Microsoft flow or Power Automate update SharePoint list increment integer field.
Here we will see how to update the SharePoint list with increment integer field using Power Automate or Microsoft Flow.
So for this example, I have created a NewsletterBenefits list, from this list we will use the Title Id which is a number/integer field.
So in the SharePoint list, we have a list of items, and every day we want to send one post to the Team channel.
From the SharePoint list, it will continue to loop through all the items in the SharePoint list, no matter how many items are there. Then we will post every day the content of one item in Microsoft teams.
So here those items get posted in the Teams, those item identifiers i.e. Title id will get updated with plus 1 in the SharePoint list.
Here we will see the steps for Microsoft flow update SharePoint list increment integer field.
Step 1: Create a SharePoint list
I have already created a SharePoint list, called BenifitsNewsletter, it contains 3 columns with column types.
|Title||Single Line of Text|
|Description||Multi-Line of text|
So in this SharePoint list, I have added three items.
Once the SharePoint list is ready, we will create a Flow.
Step 2: Create a Flow in Power Automate
To create a Flow, log in to Power Automate, then click on Create and select Scheduled Cloud Flow.
Now provide the flow name, and then set the date and time and frequency as Every day.
Step 2: Initialize 3 variable
Now we will initialize 3 variables, i.e. MaxTitleid, MinTitleId, NewTitleId, to store the maximum current value from the Titleid Field, to store the min current value from the Title id field and hold the MaxTitleid +1 value and also replace the existing value of the Title id field in SharePoint list when that item gets used.
So, click on the Next step and select Initialize variable action, and then set the variable name type as float and value as 0.
Step 3: Get Max Title id value
To get the Max title id value from the SharePoint list items, click on the next step and then select Get items action.
Then Provide the site address and list name of your SharePoint list.
Then click on Show advanced options, in the OrderBy field set the Titleid desc, to get the max number. And then set the top count as 1 like the below screenshot.
Step 4: Set the Max value in the MaxTitleid
To set the Max value we get from the previous step, click on the Next step and then select Set variable action.
Then select the variable, MaxTitleid, and in value select Title id from the dynamic content. When you set the value it will automatically add the Apply to each action.
Step 5: Increment value with +1
Now in this step, we will do the operation i.e. MaxTitleID + 1, store it into the NewTitle id variable.
So, click on the Next step and then select the Increment variable action, then select the variable name as NewTitleId, and then set the value with the below expression:
Step 6: Get the lowest value
To get the Lowest value from the same SharePoint list items, click on the Next step and then select the Get items action, then provide the site address and list name of the SharePoint list.
Then click on the Show Advanced option, and then set the order by as ascending i.e. TitleId asc to get the lowest id value. Then set the top count as 1.
Step 7: Save the minimum value in the variable
To save the lowest value get from the previous step, so click on the Next step, and then select Set variable action.
Then in the name Field, select the MinTitle variable, and in the value set the Title id from the dynamic content and it will automatically add the Apply to each action.
Step 8: Post the information on Teams
In this step we will Post the information on Teams, we will share the SharePoint list items, which Title id is lowest.
So, click on the Next step and then select the Post message in a chat or channel action. Then provide the post as, post in, Team, Channel and set the message from the dynamic content, it will automatically add Apply to each action.
Step 9: Update item with new value
Now we will update the item that we used in the previous step i.e. post information on teams and then replace the existing Titleid value, with the variable NewTitleId(contain MaxTitleid +1).
Now we will use the lowest TitleId value from the SharePoint list, and then we will replace the Title id value with the highest value and update the item in the SharePoint list.
So click on the Next step and then select the Update item action and then provide the site address, list name and then provide the id value, it will automatically add the Apply to each action. Next set the Title and in Title id value
Once your Flow is ready you can run the Flow manually
Step 10: Run the Flow
Now the flow will run every day, and for testing purposes, we will trigger it manually. So click on save and run the flow manually. You can see your Flow ran successfully
Next check the team channel of your site you will receive a message.
At last, you can see the lowest item gets updated with the highest value in the SharePoint list.
This is how Microsoft flow updates the SharePoint list increment integer field.
Related Microsoft Flow tutorials:
- How to move emails to folder after 30 days using Power Automate
- Power Automate list rows present in a table filter query
- Power Automate get events into excel
- Microsoft flow send email based on create date
- Power Automate or Microsoft Flow check day of week
- Power Automate SharePoint Get Items Filter Query
In this Power Automate tutorial, we learned how Microsoft flow or Power Automate updates the SharePoint list increment integer field.
Bhawana Rathore is a Microsoft MVP (3 times in Office Apps & Services) and a passionate SharePoint Consultant, having around 10 years of IT experience in the industry, as well as in .Net technologies. She likes to share her technical expertise in EnjoySharePoint.com and SPGuides.com