cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Filling form fields based on specific record in data source

I am looking to bring information from a third party system (assume a Data Source already connected to the app) and fill in fields based on a user's input.

 

As an example, the user may enter a username into a text box and click on a button, that will then pull the user's details from the data source and populate the Phone Number and Email Address text boxes. The user can then change those fields if they wish.

 

I am trying to make this work with a combination of collections, context variables etc with the value stored in the "Default" field of the text box (and using Reset when the user changes the username), but finding this quite challenging. Is there a better way of doing this?

1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Community Support
Community Support

Hi @Anonymous ,

 

I suggest you to change these fields by EditForm rather than custom text box, then there is no need to worry about Default property.

1. Use LookUp function to retrieve back the record from the data source

Button.OnSelect: Set(SelectedItem, LookUp('Data Source',username=TextInput1.Text));EditForm(FormName)

2. Bind the Form to the SelectedItem

Form.Item: SelectedItem

3. Add a SubmitButton, set OnSelect: SubmitForm(FormName)

 

Hope this helps,

Sik

View solution in original post

1 REPLY 1
v-siky-msft
Community Support
Community Support

Hi @Anonymous ,

 

I suggest you to change these fields by EditForm rather than custom text box, then there is no need to worry about Default property.

1. Use LookUp function to retrieve back the record from the data source

Button.OnSelect: Set(SelectedItem, LookUp('Data Source',username=TextInput1.Text));EditForm(FormName)

2. Bind the Form to the SelectedItem

Form.Item: SelectedItem

3. Add a SubmitButton, set OnSelect: SubmitForm(FormName)

 

Hope this helps,

Sik

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,287)