Hi Team,
Please guide me how to auto populate 'UserID' column in SharePoint.
Currently, there is a legacy sharepoint workflow which is populate the 'UserID' Column.
Little background on working on this column. When a new entry is added/saved in the list - the column 'UserID' displays a number (example 123) and this number is assigned to the user who created the item. Now if the user creates a second item in the list the same number allotted to him will be displayed under 'UserID' column. Meaning stamping only happens when a new entry is made
For repeated or multiple entries the number allotted previously will be displayed in the column.
How can we use PowerAutomate to replace the old working on workflow
Logic that came to me was
Step 1 - When an item is created in SharePoint
Step 2 - Check if the number is already allotted
Step 3 - If the number is not allotted then allot a new number in continuation of the pervious pattern which the legacy workflow was doing.
Step 4 - terminate the flow as 'success'
Solved! Go to Solution.
Hi @AshishJaiswal ,
Nothing special in this task:
Before update item on the Yes branch of the if claus, use a Sharepoint - get items action (let's call it - get max usedID) to get items top 1 order by userID descending and then on userID column of update item action:
add(body('get_max_userID')['value'][0]['userID'],1)
@AshishJaiswal Please find my flow:
--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
I don't this flow checking the existing ID.
Because the ID is present no need to assign a new one
If not present then assign new number - with continuation of pervious pattern
Hi @AshishJaiswal ,
Nothing special in this task:
Before update item on the Yes branch of the if claus, use a Sharepoint - get items action (let's call it - get max usedID) to get items top 1 order by userID descending and then on userID column of update item action:
add(body('get_max_userID')['value'][0]['userID'],1)
User | Count |
---|---|
27 | |
14 | |
12 | |
9 | |
9 |
User | Count |
---|---|
50 | |
30 | |
27 | |
24 | |
20 |