cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
thatakke
Helper II
Helper II

Scrollable display form for multiple forms

Hello,

 

I'm building a roster app that is connected to a SharePoint list and for data collection, it's working as expected. However, once people submit their data, I want to show a summary of whatever they sent, which is also going to be my "edit your profile" screen, so people who have already submitted info can see, and edit things. 

 

My app consists of multiple pages, because the roster is divided into different areas, such as personal info, previous experience etc. In each screen, I have a different form that consists of different fields. When I add a display form to my summary screen, I could only set its "Item" value to one of the forms, which shows the data entered in that specific form.

Item=SignUp1.Updates

 But what I want to do is:

Item=SignUp1.Updates && SignUp2.Updates && SignUp3.Updates

Obviously, PowerApps doesn't allow me to use && to add multiple forms.

 

How can I create a display form that shows multiple forms? What's the best way of showing a summary page aka show submitted data page in this scenario?

 

Many thanks

1 ACCEPTED SOLUTION

Accepted Solutions
StalinPonnusamy
Community Champion
Community Champion

Hi @thatakke

 

As per my previous note, it should create a new all times. Now next step is to create and update the part. Telling the system whether to create or update. 

 

Set(
    LastCreatedID,
Patch(
    'SPList',
        If(
            EditForm1.Mode = FormMode.New,
            Defaults('SPList'),
            LookUp(
                'SPList',
                ID = LastCreatedID //(ID selected from the Gallery) like BrowseGallery1.Selected.ID
            )
        ),
    Form1.Updates,
    Form1_1.Updates,
    Form1_2.Updates,
    Form1_3.Updates
).ID);
Navigate(SummaryScreen);

 

View solution in original post

10 REPLIES 10
StalinPonnusamy
Community Champion
Community Champion

Hi @thatakke

 

The form is targeted to only one SharePoint list.

 

Option 1: Merge all data into one collection and use the collection as a data source to the form

Form DataSource - ColName

Item - Targeting specific item using Lookup

 

Option 2: Display multiple forms

 

Thank you for the swift response @StalinPonnusamy 

It's my second week with PowerApps so I don't know much about merging into a collection. Right now, on my last page my button patches all the forms.

Patch(
    'SPList',
    Defaults('SPList'),
    Form1.Updates,
    Form1_1.Updates,
    Form1_2.Updates,
    Form1_3.Updates
);
NewForm(Form1);
NewForm(Form1_1);
NewForm(Form1_2);
NewForm(Form1_3);
Notify("We have received your inputs", NotificationType.Success);
Navigate('Welcome Screen')

 Can you guide me how to change it to a merge? Then I can add this button to my "summary" page. 

Thanks,

Drrickryp
Super User
Super User

@StalinPonnusamy 

The datasource for a form must be an actual connector. A collection or variable cannot be used as a datasource for a form.

The use case is, form is used as a summary screen (read-only). Collection can be used as a data source for the form.  Sorry If I misunderstood differently.

 

StalinPonnusamy_1-1630690585294.png

 

ClearCollect(
    ColDisplayFormData,
    {
        ID: 2,
        FirstName: "John",
        LastName: "Connor"
    },
    {
        ID: 1,
        FirstName: "Stalin",
        LastName: "Ponnusamy"
    },
    {
        ID: 3,
        FirstName: "Eric",
        LastName: "Li"
    }
);

 

StalinPonnusamy
Community Champion
Community Champion

Hi @thatakke

 

After reading your requirement, I see you have multiple forms but for the same SP item. 

 

1. Update your patch command to get newly created ID

Set(
    LastCreatedID,
    Patch(
    'SPList',
    Defaults('SPList'),
    Form1.Updates,
    Form1_1.Updates,
    Form1_2.Updates,
    Form1_3.Updates
    ).ID
);

2. On the summary screen

Set item property to

LookUp('SPList', ID=LastCreatedID)

 

Thanks @StalinPonnusamy and @Drrickryp but I'm afraid I'm too new to PowerApps to understand the suggestion. I changed my "next" button's OnSelect function to Collect but I cannot make the Display Form in my summary screen to show the collection.

StalinPonnusamy
Community Champion
Community Champion

Hi @thatakke 

 

  • In the Edit screen, update the patch function like below (It patches all the forms and capture the newly created ID) and navigate to a summary screen
Set(
    LastCreatedID,
Patch(
    'SPList',
    Defaults('SPList'),
    Form1.Updates,
    Form1_1.Updates,
    Form1_2.Updates,
    Form1_3.Updates
).ID);
Navigate(SummaryScreen);
  • In the summary screen
    • Insert a "Display Form"
    • Set Datasource property to "SPList"
    • Set Item property to LookUp(SPList, ID=LastCreatedID)

 

Note: The above functionality is to create a new record/item and navigate to the summary screen. We need to update the patch command bit more for New and Edit

 

Many thanks for your support @StalinPonnusamy 

 

Following your steps, I have managed to implement the solution. It works, as in, I can see the data in the summary screen on a Display Form. However, I'm having two issues. The simpler issue is I'm getting this weird text for some fields. I fixed this issue by changing the text of the labels to the corresponding text input in the edit form. But I would love to hear your opinion as well. 

thatakke_1-1630935794281.png

 

 

Secondly and more importantly if users entered wrong information and change their entries, it creates multiple entries in SharePoint, instead of editing the existing information. See below, I wanted to change the sex of the same entry:

thatakke_0-1630935385900.png

Any suggestions?

 

Thanks,

 

StalinPonnusamy
Community Champion
Community Champion

Hi @thatakke

 

As per my previous note, it should create a new all times. Now next step is to create and update the part. Telling the system whether to create or update. 

 

Set(
    LastCreatedID,
Patch(
    'SPList',
        If(
            EditForm1.Mode = FormMode.New,
            Defaults('SPList'),
            LookUp(
                'SPList',
                ID = LastCreatedID //(ID selected from the Gallery) like BrowseGallery1.Selected.ID
            )
        ),
    Form1.Updates,
    Form1_1.Updates,
    Form1_2.Updates,
    Form1_3.Updates
).ID);
Navigate(SummaryScreen);

 

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,540)