web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Modify / Add Data from...
Power Apps
Answered

Modify / Add Data from an SQL View Using EditForms

(0) ShareShare
ReportReport
Posted on by 43

Hello! I'm still pretty new with PowerApps and would like to know the best way to edit / add data in an SQL view. Basically, I have a canvass app connected to an SQL DB. The DB has multiple tables and consolidated to a view. If I want to add / edit the view, I need to edit the underlying table (let's call it master table) where it gets the data from. I used an edit form with master table as the source.


Is lookup function an effective way to do this? I tried patterning my lookup with Shane Young's tutorial video but just couldn't make it work and I always get the message "This formula uses scope, which is not presently supported for evaluation." I don't think it would be that straight forward since I want to edit the master table so in the editform, the datacard values should show it's corresponding value from the view and not the master table.

Categories:
I have the same question (0)
  • eka24 Profile Picture
    20,923 on at

    In Powerapps, you cannot edit SQL view and therefore cannot connect it to an editform.

    Rather connect the underlying Tables to the Editform. You can connect the view to a Gallery to view the information.

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

    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.

  • YongJaco Profile Picture
    43 on at

    Hello! That's what I have set up, sorry if my initial description wasn't clear. What I have designed is when I select from the data table, it will show all the row's details (from SQL view). But when I edit, on the edit form (which uses an underlying table as source), I want to see the values from the view instead of the underlying table. For instance, my SQL view shows a product name but the SQL table source shows it's product code. This product code is then related to another table which contains the product name matching the product code.

  • eka24 Profile Picture
    20,923 on at

    What is the name of the Table that connects the editform. 

     

    What is the name of the view that connects the Datatable.

     

    What colum Link the two 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.

  • YongJaco Profile Picture
    43 on at

    What is the name of the Table that connects the editform. -- ClientProductUse

     

    What is the name of the view that connects the Datatable. -- ClientProductUseView

     

    What colum Link the two tables -- ClientProductUseID from ClientProductUse table matches with ClientProductUseViewID.

  • eka24 Profile Picture
    20,923 on at

    My understanding is that when you select from the Datatable, it should show corresponding in the edit form.

     

    So on the Item property of the form Put:

    Filter(ClientProductUse,ClientProductUseID=DatatableName.Selected.ClientProductUseView)

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

    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.

  • YongJaco Profile Picture
    43 on at

    Yes, the datatable would show its details in the form but since I used a different source form the form, it's just blank on all fields. I tried the function below but it did not give the desired result. Will try patch this time and see if that let's me to execute the idea.

  • eka24 Profile Picture
    20,923 on at

    Please are you saying it didn't show the Data in the form?

    Can you give a screenshot..

     

    Maybe I don't understand exactly what you want to do

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

    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.

  • YongJaco Profile Picture
    43 on at

    Hi! Thanks so much for the patience. I appreciate I might not be explaining things too well since I'm still new to this. Unfortunately, I cannot take a screenshot of the powerapps and db as they I am working on a copy of actual data. I'll explain here as much as I can using some screenshots I made.

     

    1. This is how the datatable looks like. It shows the actual product name and uses the view.

    Screenshot_20200606-041822_Gallery.jpg

     

    2. Then this is the editform. The value it will display is a product ID.

    Screenshot_20200606-041803_Gallery.jpg

    Another table manages the relation between the product ID and product name. In the DB, the ID is set to INT while name is VARCHAR. We programmed the view in SQL to display names based on product IDs from editform source table.

    20200606_040751.jpg

     

    So basically, I should pass the value of the selected item in the datatable to the editform. However, the editform then should display the productname selected from the datatable instead of the productID based on the Products database. Then when the form is submitted, instead of product name, it would just pass the ID back to the editform's source table since the variable holding it in the DB is an INT. The view will then adjust accordingly.

     

    Apologies for the very long explanation but I hope I made it more clear 🙏

  • Verified answer
    YongJaco Profile Picture
    43 on at

    Apologies for not getting back on this thread. I decided to use PATCH() to update our database.

  • nileshvk Profile Picture
    45 on at

    For those who need further assistance, Pls check here

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
wolenberg_ Profile Picture

wolenberg_ 119 Super User 2026 Season 1

#2
WarrenBelz Profile Picture

WarrenBelz 107 Most Valuable Professional

#3
Haque Profile Picture

Haque 103

Last 30 days Overall leaderboard