cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
maries1986
Helper IV
Helper IV

Calculated field from Sharepoint ID

Hi,

 

I have a powerapp form where i put numbers and text from 3 fields to populate one field.  it all works good with the following formula:-

Concatenate(Dropdown3.SelectedText.Value, "-P", DataCardValue43.Text , "-", DataCardValue6.Text)
 
The problem is one of the number fields is the Sharepoint ID......i need to save the form and edit then resave for the ID field to populate in the calculated field.  
 
I trying doing a refresh on the sharepoint intregration with OnSave but that didnt work.  
 
Is there any why i can get the ID to update before i save maybe?  i can see the other 2 fields populating live as i fill out the form but of course the ID wont until i save it and SP generates it 
1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@maries1986 

So in your OnSuccess of the form, you will need to supply the following formula:

 

UpdateIf(yourDataSource, ID=Self.LastSubmit.ID,
    {yourColumnToUpdate: Self.LastSubmit.Code & "-P" & Self.LastSubmit.ID & "-" & Self.LastSubmit.'RFS/W No'}
)

 

Although you supplied the column names, I am not sure how they relate to the datacards you originally had in the formula you first posted.  The above is a guess, so rearrange as necessary. 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

7 REPLIES 7
RandyHayes
Super User
Super User

@maries1986 

You will need to do this in the OnSuccess of your form as an additional action.

Let me know what the names of the columns are in your record that make up the three fields you want to put together and I can suggest for you what you need in the OnSuccess.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
maries1986
Helper IV
Helper IV

Thanks @RandyHayes 

 

The column names are:-

 

Code-ID-RFS/W No

RandyHayes
Super User
Super User

@maries1986 

So in your OnSuccess of the form, you will need to supply the following formula:

 

UpdateIf(yourDataSource, ID=Self.LastSubmit.ID,
    {yourColumnToUpdate: Self.LastSubmit.Code & "-P" & Self.LastSubmit.ID & "-" & Self.LastSubmit.'RFS/W No'}
)

 

Although you supplied the column names, I am not sure how they relate to the datacards you originally had in the formula you first posted.  The above is a guess, so rearrange as necessary. 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
maries1986
Helper IV
Helper IV

@RandyHayes 

 

Great!  thanks...it worked.

 

this is what i have in the OnSuccess now - 

UpdateIf('Engagements Testing new app', ID=Self.LastSubmit.ID,
{'Systal PCode': Self.LastSubmit.Code & "-P" & Self.LastSubmit.ID & "-" & Self.LastSubmit.'RFS/W No'}
);

ResetForm(Self); RequestHide();
RandyHayes
Super User
Super User

@maries1986 

Excellent!  So if all is working, please go back to my response with the formula and mark it as a solution so others can find similar problems and solutions easier.

Thanks!

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
maries1986
Helper IV
Helper IV

Done for you @RandyHayes 

 

You missed out the last & before Self......if you can edit.....stick it in incase others dont spot it 🙂

 

Thanks again!  i had been at that for hours!

RandyHayes
Super User
Super User

@maries1986 

Good call...took me a minute to even spot what you were talking about.  Saw it and corrected!  Thanks for pointing out.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,639)