cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JJ1994
Frequent Visitor

One screen with multiple forms from one record

I am building a simple contact management database.

 

I have two lists, one with the details of the contact in and another recording communication history eg. ‘Had online meeting’ ‘email’ etc. along with date and notes etc.

 

I have a vertical gallery which displays the names of contacts and the company they represent which is searchable/filterable. 

I would now like to be able to select a contact from the gallery and have it bring me to a new screen that shows both the contact details and the contact history. So if I click on Joe Smith, I will get a screen that show me Joe Smiths’s name, phone, email, company and show me a list of previous communications eg. 24\1\2021 - email - re; proposed meeting, 25/1/2021 - meeting - re; adaptations campaign.

 

I know I could make two forms, but I don’t know how to relate them back to the name I selected so they retrieve the relevant information to that person on the new screen and how I can get the communication history form to pull up and show the communication history.

 

I hope that makes sense. I built it in access and got it working but that’s not good enough for share point so lucky me I get to learn something new again 😂

2 ACCEPTED SOLUTIONS

Accepted Solutions
RandyHayes
Super User III
Super User III

@JJ1994 

I would avoid using Lookup columns in your list whenever possible.  If your app is going to be the consumer of the list, then there is no need for them as they are purely about user interface in SharePoint.  IN other words, using a numeric column to store the ID of the related record is much easier to work with in PowerApps. 

 

That said, your formula on the Items property should be this:

   Filter(ContactHistory, FullName.Value = ContactRecordsGallery.Selected.FullName)

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

RandyHayes
Super User III
Super User III

@JJ1994 

Yes, your Item property of the edit form should be set to the selected contact.

So, based on the prior information, your Item property should be: ContactRecordsGallery.Selected

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

12 REPLIES 12
RandyHayes
Super User III
Super User III

@JJ1994 

For your Contact, it is fairly straightforward.  What I am missing in understanding is that you mention the communication with the contact...would this not be several records of information, not just a record?

If it is several records, then a Form is not what you need as it is focused on a single record.

 

For the Contact though, you simply need to relate the Item property of the form to the item selected in your gallery.

 

Let's say your gallery has an Items property of ContactList

Then your form would have ContactList as the datasource and the Item property would be yourGallery.Selected

 

Now, again, as for the communications, I'd need to know more about this in your scenario - is this a single record or multiple records in your list?

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

It’s one list. Columns:

  • contact name,
  • communication date,
  • communication method, eg. Email, meeting
  • staff member who communicated with them,
  • notes.

 

then I’ll have each row on the list as one ‘communication’. I presume there’s a way to pull all the ‘communications’ which are listed by a specific contact name.

 

 

RandyHayes
Super User III
Super User III

@JJ1994 

Yes, so you are referring to multiple rows in your datasource for each communication.

If so, then a Gallery listing the communications would be more appropriate. 

So, if your Communications are in a Communications List, then your Gallery Items property would essentially be:

   Filter(CommunicationsList, ContactName=yourGallery.Selected.ContactName)

Assuming that ContactName is what links the two lists together.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!
JJ1994
Frequent Visitor

Ok, so I've tried that and I think the gallery solution is right, it seems to give me what I'm looking for, its just the filterning aspect now. I tried putting in the formula, but it just gave me the error below. 

 

For reference I've included the Sharepoint list column headings for my contacts and for the communication history.

 

 

JJ1994
Frequent Visitor

Also, how do I get the form to pre-populate with the information relevant from the contact I select in the 1st gallery screen?

 

Forgive me, I'm quite new to this!

 

RandyHayes
Super User III
Super User III

@JJ1994 

What is the error you are getting on the Items property of your Gallery?  Although the tool on the right mentions invalid argument, which one.

Place your point into the formula for the items and it should underline what is the issue.

I suspect your FullName column is perhaps not just a text column??  Can you tell me what the columns types are that you showed?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

@JJ1994 

Let me know more about what you have for the Items property on the Gallery of the first screen.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!
JJ1994
Frequent Visitor

This is the formula for my gallery. It seems to be the '=' that's seen as the error.

 

The fullname column in the contacts list is a text box, but its a lookup menu on the contacthistory list which pulls the names from the fullname column in the contacts list. This is so they can't add a contacthistory not assigned to an already created contact.

 

In the contacts list the other drop downs are 'organisation' 'individual type' because these pull from different lists. In the communications history 'full name' 'contacttype' and 'staff initials' are drop downs pulling from different lists. 'Fullname' in communications history pulls from 'Fullname' in contacts.

 

The first gallery, the one used to select a name, is set up to show their name as a title and the organisation as a subtitle.

RandyHayes
Super User III
Super User III

@JJ1994 

I would avoid using Lookup columns in your list whenever possible.  If your app is going to be the consumer of the list, then there is no need for them as they are purely about user interface in SharePoint.  IN other words, using a numeric column to store the ID of the related record is much easier to work with in PowerApps. 

 

That said, your formula on the Items property should be this:

   Filter(ContactHistory, FullName.Value = ContactRecordsGallery.Selected.FullName)

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (48,082)