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 / ForAll Collection Patch
Power Apps
Answered

ForAll Collection Patch

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi All,

In my app, I have a questionnaire built in a gallery.
My goal is upon successfully answering all the required questions, patching those questions that have been answered.
As I have a few different types of questions in my gallery, such as date or text, I am saving the answers in a hidden Answers_lbl of each gallery Item, then for all the gallery items where Answers_lbl is not Blank, I am creating a collection. In a next screen the user needs to confirm their answers and I want to patch the items of the collection. I am using a dataverse as my data source to save all of my answers.
My current formula for Patching the collection items is the following:

ForAll(
 ColAnsweredQuestions,
Patch(
 'Questionnaire answers',
 Defaults('Questionnaire answers'),
 {
 Answer: CAnswer
 }
 )
); 

 
I get an error that my ForAll and Patch functions have some invalid arguments. Any ideas on where am I making a mistake?

Categories:
  • Verified answer
    BCLS776 Profile Picture
    8,994 Moderator on at

    What is CAnswer? If it is a field in the ColAnsweredQuestions collection, you'll need to modify your code to this:

     

    ForAll(
     ColAnsweredQuestions As aQuestion,
     Patch(
     'Questionnaire answers',
     Defaults('Questionnaire answers'),
     {
     Answer: aQuestion.CAnswer
     }
     )
    ); 

    Hope that helps,

    Bryan

  • surajkv Profile Picture
    89 on at

    Hi @Anonymous Please can try below formula


    ForAll( ColAnsweredQuestions,
    Patch('Questionnaire answers',
    {
    Answer: CAnswer
    }))

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard