cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Malcyt
Level: Powered On

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
tchin-nin
Level 10

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

 

2 REPLIES 2
tchin-nin
Level 10

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

 

Malcyt
Level: Powered On

Re: ONSUCCESS with Custom SP Form

Thanks Theo,

 

Perfect......

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 79 members 4,475 guests
Please welcome our newest community members: