cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ShannonC
Frequent Visitor

Patch Shared unique ID into Sharepoint List

I'm creating an app that patches multiple items at once into a Sharepoint list, I'm wanting these items to be associated with each other via a unique ID only they all share.

Is it possible to have a column in a Sharepoint List that Powerapps can check when patching and when adding the new items into the list, put the next increment of that number for their rows?


If not, ideas for other solutions welcome

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @ShannonC ,

Quite easily (for example) if you use a number and column RefID below - you would find the biggest one and add 1

 

With(
   {
      wRef:
      Sort(
         ListName,
         RefID,
         Descending
      )
   },
   Patch(
      ListName(
      ForAll(
         YourPatchingList As aPatch,
         {
            Field1: aPatch.Field1,
            Field2: aPatch.Field2,
            . . . . . . . . .
            RefID: First(wRef).RefID + 1
         }
      )
   )
)

 

I have also allowed for the same field names in source and target above.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

 

View solution in original post

2 REPLIES 2
WarrenBelz
Super User
Super User

Hi @ShannonC ,

Quite easily (for example) if you use a number and column RefID below - you would find the biggest one and add 1

 

With(
   {
      wRef:
      Sort(
         ListName,
         RefID,
         Descending
      )
   },
   Patch(
      ListName(
      ForAll(
         YourPatchingList As aPatch,
         {
            Field1: aPatch.Field1,
            Field2: aPatch.Field2,
            . . . . . . . . .
            RefID: First(wRef).RefID + 1
         }
      )
   )
)

 

I have also allowed for the same field names in source and target above.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

 

Fantastic, worked like a charm 🙂

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,344)