Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Pages - Power Apps Portals
Answered

How To Prepopulate Field From The Previous Form

(0) ShareShare
ReportReport
Posted on by 249

hello,

 

I have create a button that shows a popup window to assign a note to a ticket. Well now I want the ID or Ticktnumber Prepopulate in my second form (differt table, differt from).. I'm at the right spot because I can enter some pre filled in random text but how can I get the right date from the underlaying form?

 

So in the portal management in the box Value? Does someone has some ideas what to fill down there?


See attachments :)! Thx!!

 

  • Verified answer
    Robin1988 Profile Picture
    249 on at
    Re: How To Prepopulate Field From The Previous Form

    @Atiour thx for the help. Got it!

     

    Previous Form:

    $(document).ready(function(){
     var currentRecordId = $('#cr5ba_id').val();
     window.localStorage.setItem('vorigeId', currentRecordId); 
    });

     

    Next form:

    $(document).ready(function(){
     var previousTickedId = window.localStorage.getItem('vorigeId'); 
     document.getElementById("idxat_ticketid").value = previousTickedId;
  • Verified answer
    MOHAMMAD Profile Picture
    105 on at
    Re: How To Prepopulate Field From The Previous Form

    @Robin1988 

    In your first attachment use this code:

     

    // Using jquery Get value from your field by name
    var currentRecordId = $('#cr5ba_id').val(); 
    
    // Set value into previous step/Form
    window.localStorage.setItem('ticketid', currentRecordId);

     

     

    Regards

    Mohammad

  • Robin1988 Profile Picture
    249 on at
    Re: How To Prepopulate Field From The Previous Form

    Hi! That is not possible for me in this situation because I have a relation just for the test. But there not realy related to eachother. I'm sure javascript has to do the job... thx for your help!

  • Robin1988 Profile Picture
    249 on at
    Re: How To Prepopulate Field From The Previous Form

    Hi @Atiour , hmm to bad no reaction from the form. I'm very close. I'm sure..

    I dont know what to ask more from you. maybe one last check to my two attachments. I'll try my self some more! Thx for the help!

  • MOHAMMAD Profile Picture
    105 on at
    Re: How To Prepopulate Field From The Previous Form

    @Robin1988 

    // Set value into previous step/Form
    window.localStorage.setItem('studentregistrationadvancestudentGuid', studentGuid);

     

    studentregistrationadvancestudentGuid: Your defined variable name 

    studentGuid: D365 field value which you want to pass another form. 

     

    // Get value into next step/Form
    var requeststudentId = window.localStorage.getItem('studentregistrationadvancestudentGuid');

     

    requeststudentId: Get the value into another form and populate form field according to your need.

     

     

     

    Regards

    Mohammad

  • oliver.rodrigues Profile Picture
    9,342 Most Valuable Professional on at
    Re: How To Prepopulate Field From The Previous Form

    Okay, I had the impression that this was a custom pop-up, if not I don't think you need any custom code.

     

    If your lookup being populated in your pop-up? Make sure the lookup field is populated, if you only need to show the ticket ID, you can then add a quick-view form to the related entity, and add the Ticket Id to the qvf, this should show there now: Create or edit model-driven app quick view forms in Power Apps - Power Apps | Microsoft Docs

     

  • Robin1988 Profile Picture
    249 on at
    Re: How To Prepopulate Field From The Previous Form

    Hi @OliverRodrigues thx for your reply


    In the first basic form I just use the 'Additional Settings' and then the action to make a button to open another form.(See my attachment). That is auto generate the pop up to my second form.

    I have a related field and a simple text field to test both. Because in my case it doesnt matter how the 'ticket id' is copied to the next form. So only reference the text itself is enough. 

    Here is a part of the page source. So I need the variable of "cr5ba_id"

     

     

     

    _EntityFormView$cr5ba_id" type="text" value="87514" id="cr5ba_id" class="text integer form-cont

     

     


    Hope this made it more clear haha :)! Thx thxx

  • Robin1988 Profile Picture
    249 on at
    Re: How To Prepopulate Field From The Previous Form

    Hello @Atiour I tried some, but didnt work so far. But I'm not sure if I'm using the right names.
    So in your case:

    What is: studentregistrationadvancestudentGuid, something like my own variable? Or my dataverse table name?

    What is: studentGuid

    What is: requeststudentId, maybe the name of the field where I want to populate? 

    Thanks again!

     

  • oliver.rodrigues Profile Picture
    9,342 Most Valuable Professional on at
    Re: How To Prepopulate Field From The Previous Form

    hi @Robin1988 I believe you are using JS/HTML to build your custom pop-up right?

    can you share this piece of code? you need to retrieve the value of your ticket id, for example $("#<ticket id field>").val();

    and then populate this into your new pop-up, please note that this won't create any link/relationship between them, only reference the text itself

    is this what you are looking for? if the pop-up is related, did you consider adding a relationship between the tables?

  • MOHAMMAD Profile Picture
    105 on at
    Re: How To Prepopulate Field From The Previous Form

    Hi    @Robin1988 ,

    You can use javascript.

     

     // Set value into previous step/Form 
     window.localStorage.setItem('studentregistrationadvancestudentGuid', studentGuid); 
     
     // Get value into next step/Form 
     var requeststudentId = window.localStorage.getItem('studentregistrationadvancestudentGuid'); 

     

     

    Regards

    Mohammad

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Pages

#1
Lucas001 Profile Picture

Lucas001 60 Super User 2025 Season 1

#2
Fubar Profile Picture

Fubar 55 Super User 2025 Season 1

#3
surya narayanan Profile Picture

surya narayanan 35