cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
danbert1973
Helper I
Helper I

Pre-populate text field

I have what is (hopefully), a very simple query.  I am still new to Powerapps but can't find an easy answer to this anywhere.

 

I have a display form in Powerapps which contains details of a specific customer in my 'Customers' list.

 

When I click the 'Create Job' button on that form, I want to open a new item form, and pass the customer_id field from current customer into same field on the Create Job form (connected to my 'Jobs' list).  I already have a working button on the display form which opens the Create Job form and stores the current customer_id field in a collection, but I can't work out how to pre-populate the customer_id field with the collected value.  I assume I need to enter a function into the 'Default' property of the customer_id datacard, but I can't find the correct syntax.

 

Both fields are simple text fields, and I don't want the field to be editable on the Create Job form (technically it doesn't even need to be visible).

 

For reference, my source data is all in SharePoint.  I don't know if it's possible to pass the data directly from one form to the other, or if it needs to be collected first, but I'm happy with whatever works.

 

Many thanks

1 ACCEPTED SOLUTION

Accepted Solutions
eka24
Super User
Super User

On the Onvisible of the First where the the first form is, set a variable:
  Set(VarMyItem,TextBox1.Text) where you store customer_id field

 

Then in the Default Textbox2 of the Second form put: VarMyItem

 

The variable stores the input in textbox1 for Textbox2.

Please change the names of Textbox1 and Textbox2 to reflect your actual names

------------

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.

 

View solution in original post

2 REPLIES 2
eka24
Super User
Super User

On the Onvisible of the First where the the first form is, set a variable:
  Set(VarMyItem,TextBox1.Text) where you store customer_id field

 

Then in the Default Textbox2 of the Second form put: VarMyItem

 

The variable stores the input in textbox1 for Textbox2.

Please change the names of Textbox1 and Textbox2 to reflect your actual names

------------

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.

 

It is easy when you know how!

 

Excellent, that has worked perfectly, much appreciated.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,166)