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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

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.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,280)