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 a single line...
Power Apps
Unanswered

Patching a single line of text and choice column in SharePoint list

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

 

I am trying to patch a single line text column and a choice column to update in the SharePoint list using power apps. The column names are 'Volunteer' and 'Gift"(Choice column). I want to update these columns whenever a 'Volunteer'(user) after logging into the app assigns a gift that is 'Ham' or 'Turkey'(Gift) to a particular person using a badge number in the SharePoint through a submit button. Here is the current code for the Onselect property of the submit button. 

Set(
    varCardNumber,
    LookUp(
        'Associate Record',
        cardNumber = badge_number.Text,
        true
    )
);
Set(
    varGift,
    LookUp(
        'Associate Record',
        cardNumber = badge_number.Text,
        Gift
    )
);
Set(
    GiftName,
    If(
        Turkey_Toggle.Value = true,
        "Turkey",
        "Ham"
    )
);
If(
    varGift.Value = GiftName,
    Notify(
        "Gift Already Issued",
        NotificationType.Error
    ),
    If(
        varCardNumber = true,
        Set(
            varShowPopUp,
            true
        ),
        Set(
            varShowPopUpNotMatched,
            true
        )
    );
    Patch(
        'Associate Record',
        LookUp(
            'Associate Record',
            cardNumber = badge_number.Text
        ),
        {
            Gift: {
                '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
                Id: 1,
                Value: If(
                    Turkey_Toggle.Value = true,
                    "Turkey",
                    "Ham"
                )
            }
        }
    );

    Notify(
        "Patched",
        NotificationType.Success
    );
    Refresh('Associate Record');

);

 

Categories:
  • SebS Profile Picture
    4,882 Super User 2026 Season 2 on at

    @Anonymous 

     

    try below code

     

    Set(
     varCardNumber,
     LookUp(
     'Associate Record',
     cardNumber = badge_number.Text
     )
    );
    
    If(
     IsBlank(varCardNumber),
     Notify(
     "Badge Number not found",
     NotificationType.Error
     ),
     If(
     varCardNumber.Gift.Value = GiftName,
     Notify(
     "Gift Already Issued",
     NotificationType.Error
     ),
     Patch(
     'Associate Record',
     varCardNumber,
     {
     Gift: {
     
     Value: GiftName
     }
     }
     );
    
     Notify(
     "Patched",
     NotificationType.Success
     );
     Refresh('Associate Record')
     )
    )

     

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 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard