web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / AutoFill a Form from p...
Power Apps
Unanswered

AutoFill a Form from previous records?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi 

 

So my project is done and dusted - I have created a visitor registration app from powerapps, everything is working smoothly then I was hit by a question which i haven't thought about in the first place. 

 

"Is there a way so that frequent visitors won't have to fill in the form everytime they come in?"  - facepalm

 

backstory is I have a sharepoint list with visitor records to whom the "Form" is connected to, the Form updates the sharepoint list whenever someone logs in with their name, company, phone number and person they want to visit. They log out, the column gets updated with the current date and time. Gallery does not show the records whose log out column is already filled in.

 

The big question is, is it possible to autofill a form with previous records of people who have visited? like a history? How will this be pulled off with Powerapps? I think you can only connect one data to a Form. This is the last hurdle from my project and any help will be greatly appreciated.

 

Kind regards

 

Chrom3d

 

 

Categories:
I have the same question (0)
  • Meneghino Profile Picture
    6,949 on at

    Hi @Anonymous

    Yes, this can be done.

    Obviously the details depend a bit on what exactly it is you want to do, but for example you can use the StartsWith() function to query the history list using the person's name and get the data of the last record in the history list.

    However, this may require customisation of any forms that you have in your app.  I generally prefer not to use forms at all but create my own form the individual controls.  Once you start customising the out-of-the-box froms, it is often easier to start from scratch.

  • v-micsh-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

     

    Meneghino offers a workable way to deal with the situation, to filter the table first, and then get the last record. 

    Formula should be:

    Last(filter(SPList, UserName=User().FullName))

    To work with Form control, and to have the value auto-filled by the previous record submitted by the same person, we need first find the record, and then specify the value to the Default property of the corresponding DataCard control.

    For example, under the Company DataCard of the Editform control, and we would like the value to be auto-filled with the Company name last submitted by the same user, we configure the Default property of the Company DataCard control with the formula below:

     

     

    If(
     !IsBlank(filter(SPList, UserName=User().FullName)),
     Last(filter(SPList, UserName=User().FullName)).Company,
     "")

    Formula here means if the user has records submitted, it will then display the company last submitted, if not, it will display nothing.

    Configure the same way for the other DataCard.

    Let me know if it works.

    Regards,

    Michael

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks for the suggestion, this makes sense to me now alotugh not 100% yet. I've never tried this before and will try to crack it when I get the chance. Will let you guys know how it goes!

     

    just question on the formula, I have to apologize again for being a code newbie

     

    Last(filter(SPList, UserName=User().FullName))

     

    "SPList" = Sharepoint list which is obvious 

     

     

    "UserName =is the column?

    "User().FullName"  = says in the manual "Full name of the current user, including first and last names." I I am not pulling any users from let's say Office365, it's just random people from diff institutions and they might just put in Jake or Bob instead of their full names. Would there be an alternative instead of using "User().FullName" or is it the correct syntax which pulls in data in Sharepoint that is labeled as name?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I forgot to ask too where should I put this formula? 

     

    Last(filter(SPList, UserName=User().FullName))

     

    on the VisitorName DataCard's default data? Same as the location of

     

    If(
     !IsBlank(filter(SPList, UserName=User().FullName)),
     Last(filter(SPList, UserName=User().FullName)).Company,
     "")

     

    In the company's data card 

  • Air Profile Picture
    2 on at

    Did you manage to work this all out?

  • Tom_Slosse Profile Picture
    1,430 on at

    Hey @Anonymous,

     

     

    The Last function is already used in the If statement so you dont need to put it elsewhere.

    UserName is a context variable that is initialized on the OnStart or OnVisible of the first screen you show to your endusers.

    So something like this: UpdateContext({UserName: User().FullName})

     

    Kind regards

     

     

    Tom

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @Anonymous 

    I am doing a similar project to yours. I am new to PowerApps and coding. I am currently stuck on autofill date and time of visitors. is there a way you can share your app model with me, so that i can see your method of solving this model ??

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 509 Most Valuable Professional

#2
Haque Profile Picture

Haque 302

#3
11manish Profile Picture

11manish 265

Last 30 days Overall leaderboard