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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Pre-populate Fields ba...
Power Apps
Unanswered

Pre-populate Fields based on value and allowing users to edit it

(0) ShareShare
ReportReport
Posted on by 6

Hello everyone,

 

I have an powerapp that lets users complete their onboarding process. I have set up my list and forms in the app and used the Patch function to collate the responses from different screens/forms. However, I want to give users the opportunity to be able to edit their information if they please. 

 

Current situation: 

When a user inputs the Student ID and select the Peer Program, a new record is created. 

HiddenPants_0-1654141933800.pngHiddenPants_1-1654142198019.png

 

The Problem:

Users cannot edit their information. For example, if they have not finished step 2 yet, they can come back at a later date and just update that. 

 

Ideal Solution: 

Users will be able to input their Student ID and Peer Program then these will be checked in the list:

  • If a record with the same Student ID AND Peer Program is found, then that record is loaded on the following screen (that has the steps) and the answers associated with it as well. 
  • If a record with the same Student ID and Peer Program IS NOT found, then a new record will be created and users will be able to complete the form as expected. 

 

Hope this is clear but happy to explain more. 

 

Categories:
I have the same question (0)
  • Shujaath_Khan Profile Picture
    1,111 Super User 2024 Season 1 on at

    Hi @HiddenPants ,

     

    When you've said you've used Patch it's custom implementation.

    1. In screen 1 when Student Enters StudentID & Peer Program and clicks on Next
      1. Perform lookup on for above two field criteria.
      2. If result is not blank save the result(single list item) in context variable
      3.  use same ctx variable you can map the default values of the controls
      4. When student fills in the form and submits finally you can again call patch function with ID to update or if not call patch with defaults to create a new ones.

    Patch to create new :

    Patch(SPList, 
     Defaults(SPList), 
     {Status: {Value:"ABC"}}
     )

    Patch to update existing record

    Patch(List, 
     Lookup(List, ID= ctxItem.ID), 
     {Status: {Value:"ABC"}}
    )

     

    Thanks

    Please click Accept as solution if my post helped you solve your issue. If the content was useful in other ways, please consider giving it Thumbs Up.

     

  • HiddenPants Profile Picture
    6 on at

    Hello, thanks for your response. 

     

    I'm wondering if I need to add an if function to check if the result is not blank? Would they all be code on the same button? 

     

    I'm also wondering how to code storing the ctx variable? 

     

    I'm new to PowerApps sorry! 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard