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

ONSUCCESS with Custom SP Form

Hi,

I have a custom form where I want to use the List Item ID as part of a generated field using concatante

 

Concatenate("A",Right(Concatenate("000000",Text(ID)),6))

 

However when creating a NEW list Item ID is not availbale on the Form as it is not generated until the item is saved.

 

I read on here that I could use ONSUCCESS and Patch to pick up ID using LastSubmit.ID as this should be available before the form is Reset

 

Can anyone see whats wrong with this :

 

ONSUCCESS = Patch(CC_AssetReg,SharePointIntegration.Selected,{New_x0020_Asset_x0020_ID:Concatenate("A",Right(Concatenate("000000",Text(SharePointForm1.LastSubmit.ID)),6))});ResetForm(SharePointForm1); RequestHide()

 

as i dont seem to be picking up the ID 

 

Thanks

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Memorable Member
Memorable Member

Hi @Malcyt

 

What is happening is that when you create a NEW item in a custom SharePoint form, the SharePointIntegration.Selected doesnt have the value of the just added item.

 

You have to use a lookup to reference the just added item.

Also, I suggest you to use the Text function to prefixed your ID number with 0.

 

ONSUCCESS = 
Patch(CC_AssetReg,LookUp(CC_AssetReg,ID=SharePointForm1.LastSubmit.ID),{New_x0020_Asset_x0020_ID:"A"&Text(SharePointForm1.LastSubmit.ID,"000000")});ResetForm(SharePointForm1); RequestHide()

Théo

 

View solution in original post

2 REPLIES 2
Memorable Member
Memorable Member

Hi @Malcyt

 

What is happening is that when you create a NEW item in a custom SharePoint form, the SharePointIntegration.Selected doesnt have the value of the just added item.

 

You have to use a lookup to reference the just added item.

Also, I suggest you to use the Text function to prefixed your ID number with 0.

 

ONSUCCESS = 
Patch(CC_AssetReg,LookUp(CC_AssetReg,ID=SharePointForm1.LastSubmit.ID),{New_x0020_Asset_x0020_ID:"A"&Text(SharePointForm1.LastSubmit.ID,"000000")});ResetForm(SharePointForm1); RequestHide()

Théo

 

View solution in original post

Thanks Theo,

 

Perfect......

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (13,331)