cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AshishJaiswal
Super User
Super User

Calling Sharepoint 'UserId' column using PowerAutomate

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'






 

1 ACCEPTED SOLUTION

Accepted Solutions

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)

View solution in original post

5 REPLIES 5
jinivthakkar
Super User
Super User

@AshishJaiswal Please find my flow:

 

jinivthakkar_0-1612429941669.png

jinivthakkar_1-1612430102649.png

jinivthakkar_2-1612430156386.png

 

jinivthakkar_3-1612430266731.png

 

--------------------------------------------------------------------------------
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.

@jinivthakkar 

 

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

gabibalaban
Dual Super User
Dual Super User

Hi @AshishJaiswal,

Here is my proposal:

gabibalaban_0-1612432051676.png

Hope it helps !

AshishJaiswal
Super User
Super User

@gabibalaban 
This flow should add ID with continuation

 

+ 1 to pervious number 

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)

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (2,551)