Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Edit a galley selected item

Posted on by 72

Help!!! I am trying to use the patch formula to edit a record. This is the formula I tried using. My record is gallery 2. What am I doing wrong?

 

Patch('Conditioning Tool',Gallery2,{'PO number':DataCardValue11.Text,'Item number':DataCardValue4.Text,'Case quantity':DataCardValue20.text,'Dry matter %':DataCardValue7.Text,'Average Shore value'.text:DataCardKey6.Text});
Refresh('Conditioning Tool');
Navigate(Gallery2, ScreenTransition.None)

tchamb2_0-1712141149780.png

 

Categories:
  • WarrenBelz Profile Picture
    WarrenBelz 143,591 on at
    Re: Edit a galley selected item

    @tchamb2 ,

    You did not state your data source, but if SharePoint, try this

    Patch(
     'Conditioning Tool',
     {
     ID: Gallery2.Selected.ID,
     'PO number': DataCardValue11.Text,
     'Item number': DataCardValue4.Text,
     'Case quantity': DataCardValue20.Text,
     'Dry matter %': DataCardValue7.Text,
     'Average Shore value': DataCardKey6.Text
     }
    );
    Refresh('Conditioning Tool');
    Navigate(Gallery2,ScreenTransition.None)

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • CU06111240-0 Profile Picture
    CU06111240-0 72 on at
    Re: Edit a galley selected item

    Thanks. Now although the formula works it is not updating the information if I make change.

     

    Patch(
    'Conditioning Tool',
    Gallery2.Selected,
    {
    'PO number': DataCardValue11.Text,
    'Item number': DataCardValue4.Text,
    'Case quantity': DataCardValue20.Text,
    'Dry matter %': DataCardValue7.Text,
    'Average Shore value': DataCardKey6.Text
    }
    );
    Refresh('Conditioning Tool');Navigate(Gallery2,ScreenTransition.None)

  • Ramanachiappan Profile Picture
    Ramanachiappan 179 on at
    Re: Edit a galley selected item

     Hi @tchamb2 - @timl  is correct,

    Try This one,

    Patch('Conditioning Tool', 
    {ID:Gallery2.Selected.ID}, 
    {'PO number':DataCardValue11.Text, 
    'Item number':DataCardValue4.Text, 
    'Case quantity':DataCardValue20.Text, 
    'Dry matter %':DataCardValue7.Text, 
    'Average Shore value':DataCardKey6.Text
    } 
    ); Refresh('Conditioning Tool');

     

    Best regards, 
    Ramanachiappan M

     

    If my response was helpful, please select "Accept as solution" to close the item. Your thumbs up would be highly appreciated if you found it useful. Thank you!

     

  • timl Profile Picture
    timl 32,058 on at
    Re: Edit a galley selected item

    Hi @tchamb2 

    Power Apps is case sensitive so this error may be due to you referring to the Text property of DataCardValue20 with a lower case 't'. I'd suggest making sure that you spell Text with a capital T - hopefully that might help.

    DataCardValue20.Text

     

  • CU06111240-0 Profile Picture
    CU06111240-0 72 on at
    Re: Edit a galley selected item

    I am still receiving an error message. I can not figure out, why.

     

    tchamb2_2-1712143978151.png

     

  • CU06111240-0 Profile Picture
    CU06111240-0 72 on at
    Re: Edit a galley selected item

    I am still receiving an error message. I do not know why?

     

    tchamb2_1-1712143932208.png

     

  • Verified answer
    WarrenBelz Profile Picture
    WarrenBelz 143,591 on at
    Re: Edit a galley selected item

    Hi @tchamb2 ,

     

    Patch(
     'Conditioning Tool',
     Gallery2.Selected,
     {
     'PO number': DataCardValue11.Text,
     'Item number': DataCardValue4.Text,
     'Case quantity': DataCardValue20.Text,
     'Dry matter %': DataCardValue7.Text,
     'Average Shore value': DataCardKey6.Text
     }
    );
    Refresh('Conditioning Tool');

    You need Gallery2.Selected  - also you cannot Navigate to a gallery - it needs to be to a screen.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Verified answer
    Ramanachiappan Profile Picture
    Ramanachiappan 179 on at
    Re: Edit a galley selected item

    Hi  @tchamb2,


    Try this one,

     

     

     

     

    Patch('Conditioning Tool', 
    {ID:Gallery2.Selected.ID}, 
    {'PO number':DataCardValue11.Text, 
    'Item number':DataCardValue4.Text, 
    'Case quantity':DataCardValue20.text, 
    'Dry matter %':DataCardValue7.Text, 
    'Average Shore value':DataCardKey6.Text
    } 
    ); Refresh('Conditioning Tool'); 

     

     

     

     

     

    Best regards, 
    Ramanachiappan M

     

    If my response was helpful, please select "Accept as solution" to close the item. Your thumbs up would be highly appreciated if you found it useful. Thank you!

     

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,591

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,090

Leaderboard