cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Super User
Super User

Re: ONSUCCESS with Custom SP Form

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
Highlighted
Super User
Super User

Re: ONSUCCESS with Custom SP Form

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

Highlighted
Frequent Visitor

Re: ONSUCCESS with Custom SP Form

Thanks Theo,

 

Perfect......

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (12,589)