Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Use custom inputs to write data to sql table

(0) ShareShare
ReportReport
Posted on by 35

I am working to create an app that utilizes only manual inputs, meaning all of the controls will be textbox, dropdowns radio buttons etc, and I want to be able to take and write that data to multiple SQL tables. Can anyone advise on how to do this? I am familiar with creating apps based on existing data and using edit forms. How can I create a similar process to write this data?

 

Some examples

Job Status - Active, Closed, Inprogress

Job Number - AB-00001 (all jobs need to start with AB, ideally automatically)

Client Name 

etc.

Categories:
  • accorti Profile Picture
    35 on at
    Re: Use custom inputs to write data to sql table

    @v-yutliu-msft  Thank you for your response! I am not opposed to using a form and I think I will look into just using the SQL table architecture to create a form for populating those tables. 

     

     

     

    The solution you provided also sounds like the right outcome I am looking for. Can you elaborate a bit more on the use of the patch function? I need to write data to an Azure SQL db. Within the patch function, I assume I would specify the server name in the first argument, but how would I authenticate within that function?

  • Verified answer
    v-yutliu-msft Profile Picture
    on at
    Re: Use custom inputs to write data to sql table

    Hi @accorti ,

    Do you want to use multiple controls to update rather then using a form?

    Well, if so, you just need to use Patch function.

    Could you tell me the fields' data type that you want to update?

    I assume that all of them are char type.

    I've made a similar test for your reference:

    1)insert a drop down, two textinputs

    set the drop down's Items: 

    ["Active", "Closed", "Inprogress"]

    set the textinput1's Default: 

    "AB-"

    2)set the update button's OnSelect:

    If(StartsWith(Textinput1.Text,"AB-"),
     Patch(table,Defaults(table),
     {Job Status:drop down1.Selected.Value,Job Number :Textinput1.Text,Client Name :Textinput2.Text}
     ),
    Notify("Job Number should starts with "AB-"",NotificationType.Warning)
     )

    Please note that your sql table should have primary key, or else you can not update it in PowerApps.

     

     

     

    Best regards,

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,658 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard