cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Robin1988
Helper III
Helper III

How To Prepopulate Field From The Previous Form

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!!

 

2 ACCEPTED SOLUTIONS

Accepted Solutions

@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

View solution in original post

Robin1988
Helper III
Helper III

@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;

View solution in original post

10 REPLIES 10
Atiour
Helper II
Helper II

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

OliverRodrigues
Super User
Super User

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?




If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Apps Portals Super User


Oliver Rodrigues


 

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!

 

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&#32;integer&#32;form-cont

 

 


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

OliverRodrigues
Super User
Super User

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

 




If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Apps Portals Super User


Oliver Rodrigues


 

@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

Robin1988
Helper III
Helper III

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!

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 

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

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

MPP IDEAS

Ideas

Discover ideas and concepts from users like you for how to use Power Pages and take your work to the next level.

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.

Carousel Community Blog

Check out the Community Blog

Read all about the most recent blogs in the community!

Users online (3,134)