cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
roknron
Helper I
Helper I

Use one field value from most recently added record in sharepoint list to populate single hidden field of new record form

I have a PowerApp that broke do the sharepoint record limitations and solved the delegation issue but the issue now is that upon adding the the second record the hidden field is not getting the desired record data  on the initial browse screen I have set a Variable Tme for the onVisiable property, but, the variable is not updating when returning from the input for (NewForm).  If I navigate away from the browsegallery and then return the variable updates.   A simple example is you have two columns as below

 

RecNo.       Stop     Start  Total

1                  4.5       4.0      .5

2                  5.2       4.5      .7

 

Now when you add the new record the form presented only show the Stop field and I want the Start field in the form (which is hidden) to have 5.2 set for its value and the user would supply the Stop value of 6.  The app then calculates the different and fills the Total column (which is also hidden) with the results as below

 

3                   6.0      5.2      .8

 

I am having problems with updating the global variable that I am using to set the default property of start which currently is set to Tme

 

Ron

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @roknron :

Do you want to get the value of the Stop field of the newly created record in SharePoint and use it as the "Start" of the next record?

If so,you don’t even need to use variables. I have a method that allows you to directly get the "Stop" of the latest record:

First(Sort(YourSPList,Created,Descending)).Stop

 "Created" is the standard column in a SharePoint list. It records the creation time of a record. You only need to get the latest record created by sort function, and then you can get the corresponding "Stop".

Best Regards,

Bof

View solution in original post

3 REPLIES 3
v-bofeng-msft
Community Support
Community Support

Hi @roknron :

Do you want to get the value of the Stop field of the newly created record in SharePoint and use it as the "Start" of the next record?

If so,you don’t even need to use variables. I have a method that allows you to directly get the "Stop" of the latest record:

First(Sort(YourSPList,Created,Descending)).Stop

 "Created" is the standard column in a SharePoint list. It records the creation time of a record. You only need to get the latest record created by sort function, and then you can get the corresponding "Stop".

Best Regards,

Bof

View solution in original post

My sharepoint list is over 5000 records.  Isn't First excluded from the delegable functions?

Thank you

Ron

Hi @roknron :

Not matter.

Because

Sort(YourSPList,Created,Descending)

is delegable,it will return the correct value.The outer nested First function only intercepts the first item of the return value. So although the entire formula is not delegable, the final result must be correct.

Best Regards,

Bof

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,033)