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

Set Default Datacard to present previous Record

Hi,

I'm trying to set-up  in a datacard named Shift, Work Hours ect, the default to be the last record saved. By the time the person press new record, the datacards will be populated with the last saved records.

 

The intention is to reduce the amount of entry that a person will conduct during the form data entry.

 

Please any help on this,

 

Cesar L. Lebron

I

1 ACCEPTED SOLUTION

Accepted Solutions
Kimii
Resolver II
Resolver II

@cesarllebron 

1. Date - Date selection

[DefaultDate] property: Last(YourList).Date

2. Shift - is Choice

[DefaultSelecteditems] property: Last(YourList).Shift

5.  Work Hours - Manual entry data

[Default] : last(YourList).WorkHours

then same way with other cards

Hope it helps,

View solution in original post

9 REPLIES 9
Kimii
Resolver II
Resolver II

hi @cesarllebron 

You can get last record data with Last function.

please check this link below:

https://docs.microsoft.com/en-us/power-platform/power-fx/reference/function-first-last 

 

phipps0218
Super User
Super User

Hi @cesarllebron ,

 

Am I right in thinking you want to auto-populate some of the forms based on the last submission? If so use the LastSubmit function:

FormName.LastSubmit.ColumnName

Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful because this can help others.

LinkedIn: https://www.linkedin.com/in/charlie-phipps-%F0%9F%91%A8%E2%80%8D%F0%9F%92%BB-91338715b/
YouTube: https://www.youtube.com/channel/UChmFBGU1YKIU91sNMQ7buGg
Twitter: https://twitter.com/phipps0218




cesarllebron
Frequent Visitor

Good Morning

 

I tried the formula, unfortunately did not work.   Once I reset the form to document new records, the information as example working hours did not showed the last record.   

 

Attached the print screen with the steps I followed.

 

Just to mention the datacards are the following:

 

1. Date - Date selection

2. Shift - is Choice

3.  Style - Is Choise

4.  Molding Tool - Is Choise

5.  Work Hours - Manual entry data

6.  Production - Manual entry data

7.  Cavities - Manual entry data

8.  Machine Cycle - Manual entry data

9.  Employee Number- Manual entry data

 

Any thoughs?

 

 

phipps0218
Super User
Super User

On the save when it submits can you try calling a refresh to the datasource ?

cesarllebron
Frequent Visitor

How I do that?,  In the save button commands?

Kimii
Resolver II
Resolver II

@cesarllebron 

1. Date - Date selection

[DefaultDate] property: Last(YourList).Date

2. Shift - is Choice

[DefaultSelecteditems] property: Last(YourList).Shift

5.  Work Hours - Manual entry data

[Default] : last(YourList).WorkHours

then same way with other cards

Hope it helps,

Greetings Phipps0218

 

How Can I do that?

Refresh(datasourceName);

Greetings

 

Thanks for the help, It did work, however I have to use the First instead of last, because the return value was the first in the data table.  Once I changed to First, It returned the last record saved.

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,432)