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 / Update Existing Collec...
Power Apps
Unanswered

Update Existing Collection Prior to Writing to Sharepoint

(0) ShareShare
ReportReport
Posted on by 81

Scenario:

I have a three part form/process on a single page.

Top of Form:

>User Inputs a number of text fields.

>User Clicks "Add to worksheet" which adds to the gallery below and clears the fields so they can add additional items.

Middle of Form:

>Simple galleries (2) that show the data they entered above.

Bottom of Form:

>User must complete an explanation (Rich Text).

 

I then have a Button that uses:

ForAll(Collection, Patch(SharepointList, Defaults(SharepointList), { xxx:xxx, xxx:xxx}))

***However, I want to also add the explanation to the sharepoint list when the button is hit, but it is not in the collection.  After all the data (Gallery and collection) is posted to the list, I want to clear everything and navigate to a page that displays the data from the list for Approval Routing.

 

I am trying:

xxxxx})); Collect(Collectxxx, Patch(xxxxx, Defaults(xxxxx), {Explanation: Explanation}),Clear(CollectAdjustDetail))

 

That is not working.  Need ideas....

 

 

Categories:
  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Amghost ,

    Could you please share a bit more about your scenario?

    Do you want to update the explanation text into your collection before patching data into your SP list?

    Further, is there a "Explanation" column existed in your collection already? How do you collect data into this collection in your app?

     

    I assume that there is a "Explanation" column existed in your collection already, if you want to update the explanation text into your collection before patching data into your SP list, please take a try with the following workaround:

    Set the OnSelect property of the "Submit" button to following:

     

    UpdateIf(Collection, true, {Explanation: RichTextEditor1.HtmlText}); /* <-- Add formula here. Update the "Explanation" column in your collection with the Rich Text value */
    ForAll(
    Collection,
    Patch(SharepointList, Defaults(SharepointList), { xxx:xxx, xxx:xxx})
    );
    ....

    Note: Please make sure you have defined a "Explanation" column in your collection to store the Rich text value.

     

     

    More details about the UpdateIf function, please check the following article:

    UpdateIf function

     

    Best regards,

  • Amghost Profile Picture
    81 on at

    There is not an explanation in the collection as that is not added until after the initial data is in the collection.  The explanation is added after the user confirms that data entered initially at the top of the form.  I do have an explanation column in the SP list.

     

     

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Amghost ,

    Do you want to add a new 'Explanation' column into your collection along with proper Rich Text value before patching data into your SP List?

    Why not patch explanation data to your SP List directly?

     

    If you want to add a new 'Explanation' column into your collection along with proper Rich Text value before patching data into your SP List, I afraid that there is no way to achieve your needs in PowerApps currently.

    Note: The AddColumns function would return a temporary table, rather than modify the underlying table (on your side, it is the collection)

     

    As an alternative solution, you could consider patch the explanation data to your SP List directly. Please consider modify your formula as below:

    ForAll(
    Collection,
    Patch(
    SharepointList,
    Defaults(SharepointList),
    {
    xxx:xxx,
    xxx:xxx,
    Explanation: RichTextEditor1.HtmlText /* <-- Assign Explanation value to the Explanation column dirctly */
    }
    )
    );
    .... 

     

    Best regards,

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

#2
WarrenBelz Profile Picture

WarrenBelz 204 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard