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 / Patch Multiple Columns...
Power Apps
Unanswered

Patch Multiple Columns in SharePoint List

(0) ShareShare
ReportReport
Posted on by 7

I have an app that has been working perfectly using the sliders using this patch when submitting the form: 

 

Patch('SPListName', Defaults('SPListName'), {BarcodeScanned:varScan, WhenScanned:Now(), WhoScanned:User().FullName, Column1: Slider1.Value, Column2: Slider2.Value, Column3: Slider3.Value});
Reset(Slider1); Reset(Slider2); Reset(Slider3);
Set(varScan, Blank());
Navigate(HomeScreen)

 

Screen Shot 2022-10-28 at 3.03.22 PM.png

 

I am wanting to change the sliders to individual buttons with the selected button populating the column. I tried placing the buttons for the column in a container and tried this patch:

 

Patch('SPListName', Defaults('SPListName'), {BarcodeScanned:varScan, WhenScanned:Now(), WhoScanned:User().FullName, Column1: Column1Container.Value});
Set(varScan, Blank());
Navigate(HomeScreen)

 

Screen Shot 2022-10-28 at 11.11.10 AM.png

Any advice would be appreciated!

Categories:
I have the same question (0)
  • Verified answer
    Waegemma Profile Picture
    583 Super User 2024 Season 1 on at

    Hi Inelse,

     

    Since you work with sliders, I presume these values:

     

    0 = Intervene

    1 = Acceptable

    2 = Independent

     

    OnVisible property of the Screen:

     

    // Setting values to standard value 1, Acceptable
    
    UpdateContext({
     _category1: 1, // Preparation & Knowledge
     _category2: 1, // Clinical Skills
     -category3: 1}) // Time Management

     

     

    Per categoryname (Preparation&Knowledge; Clinical Skills, Time Management) you have three buttons:

     

    In the OnSelect of the Buttons: (example here: category1, just adapt for category2 and category3)

     

    Button Intervene:
    
    UpdateContext({_category1:0})
    
    Button Acceptable:
    
    UpdateContext({_category1:1})
    
    Button Independent
    
    UpdateContext({_category1:2})

     

     

    BorderThickness Button (to indicate which one is selected):

     

    Button Intervene:
    If(_category1 = 0, 2, 0)
    
    Button Acceptable:
    If(_category1 = 1, 2, 0)
    
    Button Independent
    If(_category1 = 2, 2, 0)

     

     

    Your Patch function:

     

    Patch('SPListName', 
     Defaults('SPListName'), 
     {BarcodeScanned:varScan, WhenScanned:Now(), WhoScanned:User().FullName,
     Column1: _category1, Column2: _category2, Column3: _category3});
    
    // Reset to standard value
    UpdateContext({_category1:1, _category2:1, _category3:1})

     

     

    Hope this helps,

     

    Marc

  • lnelsen Profile Picture
    7 on at

    Tried this-

     

    OnVisible property of the screen:

                UpdateContext({_category1:2,

    _category2:2,

    _category3:2})

     

    In the OnSelect of each button:

                UpdateContext({_category1:1}) and so forth…

     

    In the BorderThickness for each button. I wanted it to be a little thicker. Which it does, however, it doesn’t do it when you select the button, it does it for the last item when you select the next item.

                If(_category1 = 1, 10, 0)

     

    Patch function:

    Patch('SPListName’, Defaults(‘SPListName’), {BarcodeScanned:varScan, WhenScanned:Now(), WhoScanned:User().FullName, Column1:_category1, Column2:_category2, Column3:_category3, Comments:CommentInput.Text});

    Set(varScan, Blank());

    UpdateContext({_category1:2, _category2:2, _category3:2});

    Navigate(HomeScreen)

     

    If I take out the Column information everything else populates the SP list. As is, it doesn’t allow me to submit.

  • lnelsen Profile Picture
    7 on at

    Button selection BorderThickness resolved - moved to FocusBorderThickness.

  • lnelsen Profile Picture
    7 on at

    I modified the patch to this and it works! Thanks for pointing me in the right direction.

     

    Patch function:

    Patch('SPListName’, Defaults(‘SPListName’), {BarcodeScanned:varScan, WhenScanned:Now(), WhoScanned:User().FullName, Column1:Value(_category1), Column2:Value(_category2), Column3:Value(_category3), Comments:CommentInput.Text});

    Set(varScan, Blank());

    UpdateContext({_category1:2, _category2:2, _category3:2});

    Navigate(HomeScreen)

  • Waegemma Profile Picture
    583 Super User 2024 Season 1 on at

    Hi @lnelsen ,

     

    Good job!  

     

    Marc

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard