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 / Patching Textinput int...
Power Apps
Unanswered

Patching Textinput into datasource

(0) ShareShare
ReportReport
Posted on by 138

Hello everyone,

I have 12 textinputs in Gallery column for Months ( Jan - Dec ), I want to save all the entered data into a datasource column "target_value"

I have configured the onchange = Patch(Table2,ThisItem,{target_value: TextInput1.Text}) 

but because I have a lot of columns, it takes a lot of time to load, I need to configure a button when selected to save all the changes once.

Thanks

powerapps.jpg
Categories:
  • MSDigitalUser Profile Picture
    138 on at

    Also, I have tried the below to use lookup but it doesnot reflect on my datasource:

     

    Patch(Table2, LookUp(Table2,kpi_name=Label3.Text && product=Label4.Text && 'Month Name'=Label3_3.Text, {target_value: TextInput1.Text}))

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    Hi @MSDigitalUser ,

     

    If your data source is SharePoint - you can use the pattern below to save all changes at once:

     

     

    Patch (
     'Your Table',
     ForAll(
     Gallery1.AllItems,
     {
     ID: ID,
     target_value: TextInput1.Text
     }
     )
    )

     

     

    In case you're using Dataverse, you will need to use the unique identifier (GUID) system column instead of ID:

     

    Patch (
     'Your Data',
     ForAll(
     Gallery1.AllItems,
     {
     crbe6_sampledataid: crbe6_sampledataid,//replace with your unique identifer column
     target_value: TextInput1.Text
     }
     )
    )

     

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

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

     

  • MSDigitalUser Profile Picture
    138 on at

    Unfortunately it is not working, my datasource is an excel on onedrive. I tried the below (because I did not understand id)

    Patch(Table2, ForAll(TemplateGalleryList2.AllItems,{product:product, target_value:TextInput1.Text}))

    Patch(Table2, ForAll(TemplateGalleryList2.AllItems,{id:id, target_value:TextInput1.Text}))

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @MSDigitalUser  - apart from being a terrible and unwieldy data source, the same expression would work for Excel.

     

    Could you please be more prescriptive? Is there an error message for example?

     

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

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

  • MSDigitalUser Profile Picture
    138 on at

    There is no error message unfortunately, it is just not reflected to the datasource 

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @MSDigitalUser  - I just saw the edits to your post. 

     

    Which of these expressions are you using? I assume you have the file closed?

     

    Patch(Table2, ForAll(TemplateGalleryList2.AllItems,{product:product, target_value:TextInput1.Text}))

     

    Patch(Table2, ForAll(TemplateGalleryList2.AllItems,{id:id, target_value:TextInput1.Text}))

     

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

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

  • MSDigitalUser Profile Picture
    138 on at

    I have tried both but they did not work.

    I dont understand what do you mean by closed, but previously I used the below for the textbutton onchange and it worked:  Patch(Table2,ThisItem,{target_value: TextInput1.Text})

    but technically it is not functioning well.

  • MSDigitalUser Profile Picture
    138 on at

    Hello Amik,

    I have moved my datasource to sharepoint and still not working.

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @MSDigitalUser - by "file closed", I mean you need to ensure the Excel file on OneDrive is closed/not locked. The Patch will not work if you have the file open.

     

    I ran a test using Excel hosted on OneDrive and the expression works for me:

     

    Amik_0-1686242569585.png

     

    The below is not the same formula I sent you, so I cannot comment. "Product" does not look like an ID field.

     

    Patch(Table2, ForAll(TemplateGalleryList2.AllItems,{product:product, target_value:TextInput1.Text}))

     

    Could you share the code you're using for SharePoint.

     

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

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 239

Last 30 days Overall leaderboard