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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Update multiple record...
Power Apps
Unanswered

Update multiple records using Patch

(0) ShareShare
ReportReport
Posted on by 39

Can Anyone help me with how to update multiple records .

 

The scenario is I am displaying data from a sql table in a gallery where it has a multiple questions (as a different record).User has to rate and comment to that question and  this user input(comment and the rating count)I must update in the table.I willl be using Save and Submit option.

 

 

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,989 Moderator on at

    @PriyaShetty 
    You can simply do a bulk update like this if your collection has matching columns with the datasource.

    Patch(your_datasource_name, your_collection_name)

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

     

     

  • v-yutliu-msft Profile Picture
    on at

    Hi @PriyaShetty ,

    Do you want to update multiple records at one time? a question a record?

    Could you tell me

    1)the fields data type in your data source?

    2)what controls you use to fill in answers?

    3)the controls settings?

    If fields data type are text and number type and you use ratings and textinputs to update, then you could update with these formulas:

    ClearCollect(collection1,
    {question:"question1",
     rating:Rating1.Value,
    comment:TextInput1.Text},
    {question:"question2",
     rating:Rating2.Value,
    comment:TextInput2.Text},
    {question:"question3",
     rating:Rating3.Value,
    comment:TextInput3.Text},
    ...) ;create a collection for the answers
    Collect(tablename,collection1)
    //please make sure the related fieldnames are the same the fieldnames in collection

     

     

     

    Best regards,

  • PriyaShetty Profile Picture
    39 on at

    No I am not using all the columns present in the data source .I am display few and the user inputs Comments and Rating for the questions and that i need to save  back to the same table.

  • PriyaShetty Profile Picture
    39 on at

    @v-yutliu-msft I am using Sql db.So why i need to create a collection?

  • mdevaney Profile Picture
    29,989 Moderator on at

    @PriyaShetty 

    Using my approach, you don’t need to have all of the same columns in the datasource.  Just ensure that the columns present in your collection match the column name in the datasource.

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • PriyaShetty Profile Picture
    39 on at

    @mdevaney Currently I don not have any collection.Just a Table which I am displaying with few records.I should be able to update all the record at one button click.

     

  • mdevaney Profile Picture
    29,989 Moderator on at

    @PriyaShetty 

    Please show a sample of your app and the code you are using to display the data.  If there’s no collection storing the answers, I need to see what your actually doing.

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • PriyaShetty Profile Picture
    39 on at

    Hi @mdevaney Below is the screenshot.

    PriyaShetty_0-1593171512139.png

    I am using a table (here i have used sharepoint list to display data).I want to save and submit data.

  • mdevaney Profile Picture
    29,989 Moderator on at

    @PriyaShetty 

    Why not share all the information you tried to private message me?

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • PriyaShetty Profile Picture
    39 on at

    @mdevaney  Below is the details.

     I have a db named "response master" '[Assessment_Tool].[ResponseMaster]' I have fields ResponseID(PrimaryKey) Int QuestionNo Nchar(10) AssessmentID varchar(50) Question Nvarchar(max) Response int Comments nVarchar(max) AreaID int AssessorId int this i am displaying in a gallery "Gallery_1".Here two fields "Comments"and "Response" is for user input .Comments is Text_input and Response is Rating input.user will rate and comment all question and when he clicks on Save button.The comments and rating must saved and on "Submit" it should be updated in the table.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard