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
Thanks
Solved! Go to Solution.
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
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
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
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
User | Count |
---|---|
121 | |
88 | |
88 | |
75 | |
66 |
User | Count |
---|---|
216 | |
180 | |
138 | |
96 | |
73 |