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 / Updating a choice type...
Power Apps
Unanswered

Updating a choice type column name Status in share point list from Booked to Checked-in and Checked-in to Checked-out using a Check In/Out button in a container.

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I am trying to update a value in Sharepoint list, in a choice type column(Named: Status) with the help of a button in power-apps where if the value in the status in Sharepoint list is, 'Booked'  it will change to 'Checked-in', when I hit the Check In/Out button and similarly when I hit the button again the Checked-in will change to 'Checked-out' eventually.

This is my code, so far:

Patch(
Appointments,
LookUp(
Appointments,
Associate.Value = Associate_Number.Text
),
If(
'Checked_In/Out'.Text = {Status : {Value: "Booked"}},
{Status: {Value: "Checked-in"}},
{Status: {Value: "Checked-out"}}
)
);

 

 

 

Categories:
  • raks Profile Picture
    on at

    First, you can make your if or use a switch to put to updated value in a variable.

    After, you make a patch or an updateif to update your choice field.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Code?

  • CU-18081211-6 Profile Picture
    9,272 Moderator on at

    @Anonymous 

    The condition is quite strange. I think you need:

    'Checked_In/Out'.Value= "Booked"

     

  • raks Profile Picture
    on at

     

    If(
    'Checked_In/Out'.Text = {Status : {Value: "Booked"}},
    Set(varValue,"Checked-in"),
    Set(varValue,"Checked-out")
    );
    Patch(
    Appointments,
    LookUp(
    Appointments,
    Associate.Value = Associate_Number.Text
    ),
    {Status : {Value: varValue}}
    );

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    This is what i am using rn but it is changing everything to checkout even if it is booked skipping the checked-in.

     

    Patch(
    Appointments,
    LookUp(
    Appointments,
    Associate.Value = Associate_Number.Text
    ),
    If(
    'Checked_In/Out'.Text = "Booked",
    {Status: {Value: "Checked-in"}},
    {Status: {Value: "Checked-out"}}
    )
    );

  • raks Profile Picture
    on at

    Use switch instead if:

    Switch('Checked_In/Out'.Text,
    "Booked",Set(varValue,"Checked-in"),
    "Checked-in",Set(varValue,"Checked-out")
    );
    Patch(
    Appointments,
    LookUp(
    Appointments,
    Associate.Value = Associate_Number.Text
    ),
    {Status : {Value: varValue}}
    );
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I am getting an error in the first statement, Booked one. It says incompatibles types:

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    There is no error now but it's not working or changing the status in SP list.

  • raks Profile Picture
    on at

    Maybe could work with updateif:

    Switch('Checked_In/Out'.Text,
    "Booked",Set(varValue,"Checked-in"),
    "Checked-in",Set(varValue,"Checked-out")
    );
    UpdateIf(
    Appointments,
    Associate.Value = Associate_Number.Text,
    {Status : {Value: varValue}}
    );

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

#2
Mohsin Ali Profile Picture

Mohsin Ali 323

#3
WarrenBelz Profile Picture

WarrenBelz 193 Most Valuable Professional

Last 30 days Overall leaderboard