web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Create unique referenc...
Power Automate
Unanswered

Create unique reference ID

(0) ShareShare
ReportReport
Posted on by 103

I have a column name ReferenceID on a SP list, what I would like to do is each time an item is created in list A for the referenceID to be auto generated as ABC1 ABC2 ABC2 and so forth

 

This is part of a bigger flow which I am building which is as follows:

 

1. when an item is created in list A create in list B

2. when an item is modified in list B update list A

 

Could anyone kindly explain how I can achieve this in flow?

Categories:
I have the same question (0)
  • abm abm Profile Picture
    32,985 Most Valuable Professional on at

    Hi @MoEdu 

     

    You need to use two flows to meet your requirement.

     

    Flow 1. When an item is created
    Flow 2. When an item is created or modified. Microsoft Power Automate does not support a trigger for when an item is modified only currently. So here you need to implement your own logic. Just an idea may be checking the created and modified date is same or not.

     

    To generate the Id you need to get the latest record based on created on date from sharepoint. Find the reference id and increment to next number. Here you need to use some string manipulations to extract the number.

     

    If you need any further help please let me know.

     

    Thanks

  • v-bacao-msft Profile Picture
    Microsoft Employee on at

     

    Hi @MoEdu ,

     

    It is recommended that you directly append the Item ID to the back of AB to create the reference ID. The Item ID is the unique and non-null field, so the reference ID will also be.

     

    You could refer to the following methods to configure these two flows.

    129.PNG

    Flow 2:

    130.PNG131.PNG

    Hope this helps.

     

    Best Regards,

  • MoEdu Profile Picture
    103 on at

    Hi @v-bacao-msft

     

    I have followed your steps and it works like a charm! thank you very much! 😀

     

    I have noticed once the item is created in list A it is copied over to list B which is fine however if further updates are carried out in list A these do not appear in list B

     

    How can I ensure any subsequent updates to list A appear in list B?

     

    also I forgot to mention attachments in my post

     

    If attachments are added in list A these should also appear in list B

     

    Once in list B if list B is updated/modified and if further attachments are added or the existing ones deleted will this also be reflected in list A?

     

    And  if no attachments are added in list A but are added in list B will these appear in list A

     

    Could you kindly provide an example how I could achieve this?  

  • v-bacao-msft Profile Picture
    Microsoft Employee on at

     

    Hi @MoEdu ,

     

    “further updates are carried out in list A these do not appear in list B

    How can I ensure any subsequent updates to list A appear in list B?“

     

    If the update of List A is also synchronized to List B, then Flow will fall into a loop. Because there is an Update item action in Flow, Flow will be triggered again, which will cause many errors. I don't think this requirement can be realized through Flow.

     

    For adding attachments, you can do this through the following methods.

    Flow 1:

    152.PNG

    Flow 2:

    153.PNG

    Hope this helps.

     

    Best Regards,

  • MoEdu Profile Picture
    103 on at

    Hi @v-bacao-msft 

     

    Is there no other solution within flow that I could use? i.e if item is modified in list A update list B

     

    I'll detail out my requirements as you may have another solution

     

    If item is created in list A it should appear in list B inc attachments

    If item in list A is modified these should appear in list B inc attachments

    If item in list B is modified these should appear in list A inc attachments

     

    So to summarise, any item that is created in list A should appear in list B including any changes made after the list is saved from list A.

     

    Any changes list B does should appear in list A

     

    I hope that makes sense

  • v-bacao-msft Profile Picture
    Microsoft Employee on at

     

    Hi @MoEdu ,

     

    Unfortunately, although I would like to provide you with the right ones, relying on the current features of Flow cannot achieve such requirements, they will always fall into the loop.

     

    Maybe someone else has the right method. I am not able to provide you with the right method for the time being.🤔

     

    Best Regards,

  • Jay-Encodian Profile Picture
    2,920 on at

    Hey @v-bacao-msft @MoEdu 

    Just checking the issue... I assume you trying to avoid event recursion where the Flows are essentially triggering each other?

    If so check out this blog post which details what you need to do: https://powerusers.microsoft.com/t5/Power-Automate-Community-Blog/SharePoint-Managing-Recursive-Events-in-Flow/ba-p/250076

    Cheers Jay

  • MoEdu Profile Picture
    103 on at

    Hi @Jay-Encodian 

     

    I have SP list A, anything that is created in SP list A should appear in list B

     

    Only new items that are created appear in list B, so for example if you were to edit an item in list A make changes etc and then click save these do not appear in list B

     

    And the final step is once the item is in list B any updates that are carried out in list B should then appear in list A

     

    I hope this makes sense, the example you provided in the link will I need to create this as a new flow or add it in to the example @v-bacao-msft provided?

     

    look forward to hearing from you

  • Jay-Encodian Profile Picture
    2,920 on at

    Hey@MoEdu 

    This should be pretty simple:

    For the Flow (Flow A) on List A: use the 'When an item is created' SharePoint trigger

    For the Flow (Flow B) on List B: use the 'When an item is created or modified' SharePoint Trigger

    The slight issue is that the Flow on List B will be triggered by Flow A ... to work around the item created event, enable list versioning on List B and add a condition to check whether the current version of the triggered item is equal to '1.0', if it is then terminate the Flow, if it isn't it must be change and then you can perform your logic.

    The final thing to consider... you need a way to correlate the item in List A with the item in List B; I would suggest you create a column on List B called 'List A ID' or similar and then populate this field with the List A item ID... that way you can ensure you can get the correct list item from List A when Flow B is triggered.

    HTH

    Jay

  • MoEdu Profile Picture
    103 on at

    Hi @Jay-Encodian 

     

    I've already built the flows as per the example provided by @v-bacao-msft 

     

    The only step that is missing which I am looking for is if any changes that are carried out to list A after being saved should also appear in list B

     

    Would I need to start from scratch or do I need to insert in additional steps?

     

    I would appreciate if you could provide screenshots as I am new to flow

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 873

#2
Valantis Profile Picture

Valantis 813

#3
Haque Profile Picture

Haque 526

Last 30 days Overall leaderboard