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 Apps / How to create a reference
Power Apps
Answered

How to create a reference

(0) ShareShare
ReportReport
Posted on by 521

Hi,
How can I create a serial number at time of patching ForAll on my OrderNumber Column in SharePoint its Single line of text, I need to get something like this.?
OrderID10_03132022104229
Red: serial number
Green: Date and time
OrderID.PNG

Thanks 

Categories:
  • Verified answer
    WarrenBelz Profile Picture
    156,532 Most Valuable Professional on at

    Hi @PowerApps11 ,

    This should be the structure you are after assuming the current serial number would be in the last record of the SP List

    With(
     {
     wID:
     Value(
     Substitute(
     First(
     Split(
     Last(SPListName).OrderID,
     "_"
     )
     ).Result,
     "OrderID",
     ""
     ) 
     ),
     wCol:
     ForAll(
     Sequence(CountRows(YourCollectionName)),
     Patch(
     Index(
     YourCollectionName,
     Value
     ),
     {RowNo: Value}
     )
     )
     },
     Patch(
     SPListName,
     ForAll(
     wCol As aPatch,
     {
     OrderID: "OrderID" & Text(wID + aPatch.RowNo) & "_" & Text(Now(),"ddmmyyyyhhmmss"),
     Field1Name: aPatch.Field1,
     Field1Name: aPatch.Field2Name,
     . . . . . . . .
     }
     )
     )
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • PowerApps11 Profile Picture
    521 on at

    Hi @WarrenBelz 
    I have changed this part due to getting error RowNo not exist 

     OrderID: "OrderID" & Text(wID + aPatch.RowNo ) & "_" & Text(Now(),"ddmmyyyyhhmmss")

    @WarrenBelz  let me know if It's not supposed to modify.
    Thanks 

  • WarrenBelz Profile Picture
    156,532 Most Valuable Professional on at

    @PowerApps11 ,

    Please see updated post - you got aPatch.RowNo right, but needs a comma at the end - I tested here also and it works

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 432 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard