cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mikesmeltz
Helper II
Helper II

Recalling SQL data in a powerapp when entering the ID number.

I have a powerapp Incident Form that has about 30+ fields.

 

The user submits the data to a SQL database. Another user later on needs the ability to call up a particular record to review and/or make changes thus updating the record for that particular incident.

 

Would a display form be needed for this, and what object/function would i need for the user to enter the ID # to recall the record.

 

Thank you for any assistance you can offer.

1 ACCEPTED SOLUTION

Accepted Solutions
gabibalaban
Super User
Super User

Hi @mikesmeltz ,

If the second user knows the record ID from SQL table and can write it in a textinput control , then it's a simple task to show/edit the record:

For this, you will need a form:

Set datasource property of the form to:

               yourSQLTable (the name of the SQL table)

and item property to:

              LookUp(SQLTable, ID = Value(textinputcontrol.Text))

I supposed that ID column from SQL Table is an int type column (that why i used Value () function). Also, if my supposition is true set Format property of textinput control to TextFormat.Number.

 

To get all done ... set OnChange property of textinput control to:

ResetForm(yourNewForm);EditForm(yourNewForm)

and of course if you want to save the user's work you will need a button with OnSelect set as:

SubmitForm(yourNewForm)

 

Hope it helps !

View solution in original post

2 REPLIES 2
timl
Super User
Super User

Hi @mikesmeltz 

You can use an edit form to enable the user to edit a record. Let's suppose you add a text input control to your screen called txtID.

In your edit form, it would set the data source property to the name of your SQL table, and you would set the item property to:

LookUp('[dbo].[YourTable]', YourIDField=Value(txtID.Text))

 

gabibalaban
Super User
Super User

Hi @mikesmeltz ,

If the second user knows the record ID from SQL table and can write it in a textinput control , then it's a simple task to show/edit the record:

For this, you will need a form:

Set datasource property of the form to:

               yourSQLTable (the name of the SQL table)

and item property to:

              LookUp(SQLTable, ID = Value(textinputcontrol.Text))

I supposed that ID column from SQL Table is an int type column (that why i used Value () function). Also, if my supposition is true set Format property of textinput control to TextFormat.Number.

 

To get all done ... set OnChange property of textinput control to:

ResetForm(yourNewForm);EditForm(yourNewForm)

and of course if you want to save the user's work you will need a button with OnSelect set as:

SubmitForm(yourNewForm)

 

Hope it helps !

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,997)