web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Using Collect for Pagi...
Power Apps
Answered

Using Collect for Pagination

(0) ShareShare
ReportReport
Posted on by 105

Hello,

 

I have a project that would require pagination, in which Screen 1 is the first page of the form, then Screen 2 is the next page of the form, and then collect all of that data and add them into one collection (SPSubmit)

 

Based on my exploration, I would like to achieve the following:

Screen 1 - Fill out all fields, patch data to Page1 (collection)

Screen 2 - Fill out all fields, patch data to Page2 (collection), Patch all data (Page1, Page2) to SPSubmit (collection), Patch SPSubmit data to SPO List (SharePoint list), navigate to success screen

 

 

Screen 1

  • Declare Page1 as a Collect option
  • Patch all fields to Page1
  • Navigate to Screen 2

Screen 2

  • Declare Page2 as a Collect option
  • Patch all fields to Page2
  • Patch Page 1 and Page 2 to SPSubmit
  • Patch SPSubmit to SPO List
  • Navigate to Success Screen

 

My issue here is I am encountering an error on SPSubmit, see below:

 

In OnStart, I have the following code:

ClearCollect(SPSubmit,{Title: "",MIN: "",BusinessName: "",AuthorizedRep: "" ,BusinessAddress: "",Attendee: "",Position: "",Merch: "",FBUserName: "",DateAttended: "",TopicsTrained: ""});ClearCollect(Page1,{Title: "",MIN: "",BusinessName: "",AuthorizedRep: "" ,BusinessAddress: ""});ClearCollect(Page2,{Attendee: "",Position: "",Merch: "",FBUserName: "",DateAttended: "",TopicsTrained: ""})

 

For Page1 collection, I have the following code (for Patch only - the .text, etc. codes are found in my app as the fields):

Patch(Page1,Defaults(Page1),{Title:CardNo.Text, MIN:MIN.Text,BusinessName: BizName.Text ,AuthorizedRep: CO.Text,BusinessAddress: BizAdd.Text})

For Page2 collection, same format with Page1:

Patch(Page2,Defaults(Page2),{Attendee: DataCardValue1.Text, Position: DataCardValue8.Text ,Merch: DataCardValue10.Selected.Value ,FBUserName: DataCardValue5.Text ,DateAttended: DataCardValue2.SelectedDate ,TopicsTrained: Text(DataCardValue3.Selected.Value)});

In SPSubmit, here is the code:

Patch(SPSubmit,Defaults(SPSubmit),{Title:Page1.Title,MIN: Page1.MIN ,BusinessName:Page1.BusinessName,AuthorizedRep:Page1.AuthorizedRep,BusinessAddress:Page1.BusinessAddress,Position:Page2.Position,Merch:Page2.Merch,FBUserName:Page2.FBUserName,DateAttended:Page2.DateAttended,TopicsTrained:Page2.TopicsTrained})

This is the error:spo.png

 

Please take note that my Page1 fields are custom, while the Page2 fields are from a SharePoint form.

 

Thanks,

David

Categories:
I have the same question (0)
  • iAm_ManCat Profile Picture
    18,228 Most Valuable Professional on at

    It's saying that it's type table when it expects text - so to troubleshoot that you should insert a table into your app and set it to CO.Text (same as your formula) and then see what shows up in the table.

     

    Additionally, I would not have done a patch for the page 1 and 2 - I would have just used ClearCollect with the values, that way you know there's only every going to be one set/row of values rather than a table of rows.

  • david_castillo Profile Picture
    105 on at

    Hi @iAm_ManCat 

     

    Thanks for chiming in. For some reason, my reply was not posted here. In any case, do you mean that ClearCollect will be able to put my page1 and page2 fields together, then have that collection be patched to SharePoint?

     

    Thanks,

    David

  • Verified answer
    iAm_ManCat Profile Picture
    18,228 Most Valuable Professional on at

    Hi,

     

    Yeah, you don't need to initialize the collection onStart - I mean honestly you don't even need to collect them - you should be able to just patch them direct using the values from the other screen, unless they're being cleared between screens...

     

    Patch(

              SPSubmit,

              defaults(SPSubmit),

              {

                            Title: CardNo.Text,

                            MIN: MIN.Text,

                            BusinessName: BizName.Text,

                            AuthorizedRep: CO.Text,

                            BusinessAddress: BizAdd.Text,

                            Attendee: DataCardValue1.Text,

                            Position: DataCardValue8.Text,

                            Merch: DataCardValue10.Selected.Value,

                            FBUserName: DataCardValue5.Text,

                            DateAttended: DataCardValue2.SelectedDate,

                            TopicsTrained: Text(DataCardValue3.Selected.Value)

              }

    )

     

    Did you get a chance to try adding a table into your page 1 and set its value to CO.Text? The message states that it's picking up a table so we still need to resolve that issue before it will submit 🙂

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard