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 / Patch (update) using a...
Power Apps
Answered

Patch (update) using a collection with ShowColumns and Choice Fields

(0) ShareShare
ReportReport
Posted on by 117

I have built a collection based on filters in a gallery, and want to only update 4 fields in the record.  It successfully updates 2 of the fields but for some reason when I add 2 other fields I get an error on the button formula.

 

This part works:  

Patch(
'School Application Form',
ShowColumns(colGridUpdate,
"ID",
"Status",
"MoveYear")
)

Status (Choices) and MoveYear (Yes/No) are fields in the Sharepoint list that are successfully updated.

 

When I try to add "Year of Entry" (Choices) and/or "StudentYearGroup" (Choices) the whole formula has red squiggly lines and it fails.

 

Can anyone shed light on this please?

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,064 Most Valuable Professional on at

    HI @jms345 ,

    The format you are using relies on the 'School Application Form' List having the fields you are showing in colGridUpdate with exactly the same name and field type, so that would be a good place to start looking (do they both have the Choice fields  'Year of Entry' and 'StudentYearGroup' ? )

  • Verified answer
    jms345 Profile Picture
    117 on at

    Thanks @WarrenBelz - I had double checked the field names but found a strange anomaly: when I changed "Year of Entry" to "Year_x0020_of_x0020_Entry" it accepted this fieldname in the Patch. However it wouldn't when I tried replacing the spaces in "Student Year Group".  I went into the SP list and renamed the field to StudentYearGroup, and then put "StudentYearGroup" into the Patch statement.  It now works.

    I guess the rule should be create fieldnames without spaces...?

  • ChrisCham Profile Picture
    10 on at

    I try not putting spaces in any column name because you never know which function doesn't parse the space syntax correctly! 

  • WarrenBelz Profile Picture
    156,064 Most Valuable Professional on at

    Hi @jms345 ,

    Yes - you will not find any spaces or special characters in any of my field names.

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 337 Most Valuable Professional

#2
11manish Profile Picture

11manish 173

#3
Valantis Profile Picture

Valantis 86

Last 30 days Overall leaderboard