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 Apps
Answered

Fix Update Formula

(0) ShareShare
ReportReport
Posted on by 5,345 Moderator

Is there any way to make the below work?

I have Gallery in which I have an Icon. In the Icon OnSelect I've placed the formula below.

The intent of the formula:
If the content of the SPList ContactStatus column for that item is "Pending" clicking the Icon will change "Pending" to "Sent to Buyer".

          Update('Test List'.ContactStatus, If(ThisItem.ContactStatus="Pending",true,"Sent to Buyer")

Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Phineas 

    Please consider changing your Formula to the following:

    Patch('Test List', 
     {ID: ThisItem.ID,
     ContactStatus: If(ThisItem.ContactStatus, "Sent to Buyer", "Pending")
     }
    )

     

    The above will "flip" the status back and forth.  If you only want it to go one direction, then simply remove the If part completely and change it to: "Sent to Buyer"

     

    The above assumes that your ContactStatus is a text column in your datasource.

     

    I hope this is helpful for you.

  • Phineas Profile Picture
    5,345 Moderator on at

    PA doesn't like it. Tried both the following. Got errors.

     

    The function 'Patch' has some invalid arguments.
    The type of this argument 'ContactStatus' does not match the expected type 'Record'. Found type 'Text'.


    Patch('Test List',
    {ID: ThisItem.ID,
    ContactStatus: "Sent to Buyer"
    }
    )
    ***********************************************
    Patch('Test List',
    {ID: ThisItem.ID,
    ContactStatus: ThisItem.ContactStatus.Value,"Sent to Buyer"
    }
    )

  • Verified answer
    Phineas Profile Picture
    5,345 Moderator on at

    I figured it out.

    Variable at OnStart:      Set(varChangeStatus, "Sent to Buyer");

    Icon OnSelect:     UpdateIf('Test List', ID = ThisItem.ID, {ContactStatus: varChangeStatus});

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

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 139

Last 30 days Overall leaderboard