cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

Adding and displaying multiple comments for same customer with a date and time stamp

I have two Sharepoint lists - one name Contacts, the other named Notes.

 

When a rep visits a customer, I want them to be able to see notes from a previous visit (View) and then add a new note for this visit (basically appending rows in the Notes list). 

 

I've tried several scenarios and can't seem to find the best solution.

 

Any ideas?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Adding and displaying multiple comments for same customer with a date and time stamp

@ttaylor 

A form can only accept one record at a time so you'd have to wrap it in a function that ensures only 1 record is returned (most likely the FIRST or LAST functions).  A typical statement you might type into the Items property of the form would look like this. 

 

 First(Filter(Notes,Organization.Value =OrgDropDown.SelectedText.Value))

 

If for some reason the wrong result is showing, you might have to add further arguments to the filter to ensure the correct record is selected.  A unique value like an ID usually satisfies this problem.

 

---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."

View solution in original post

25 REPLIES 25
Highlighted
Super User III
Super User III

Re: Adding and displaying multiple comments for same customer with a date and time stamp

@ttaylor 

Here's one way you could do it:

 

  • Create a gallery containing contacts (galleryContacts)
  • Set the Items property of galleryContacts to the Contacts datasource
  • Create a gallery containing Notes (galleryNotes)
  • Set the Items property of galleryNotes to Filter(notes_sharepoint_list_datasource, galleryContacts.Selected.ID = ContactID)
  • (ContactID would be a column in your Notes datasource containing the unique ID number of the contact)
  • Now when the user clicks on a contact name it will display the contact's notes
  • Add a form (frm_addNote) in the state FormMode.New. Include any fields you require.
  • Add a submit button and use the following code:  Submit(frm_addNote); Refresh(your_notes_datasource_name_here).
  • Now when the user clicks Refresh the note will be submitted and the Gallery will be refreshed, showing the most recent note

 

That's my take on a general approach to the app design.

 

---

Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly.  If your thought the post was helpful please give it a "Thumbs Up."

Highlighted
Helper III
Helper III

Re: Adding and displaying multiple comments for same customer with a date and time stamp

Hmmm...I'm getting an Invalid Argument Type on GalleryNotes when I type in the filter info you provided. 

 

I used the Organization field in my contacts gallery (GalleryContacts). They all show up.

 

Added the a new gallery for notes (GalleryNotes) and typed

     Filter(GalleryNotes, GalleryContacts.Selected.ID = ID).

 

Since the rep might be visiting a different person in the organization each time, I want the notes to be tied to the organization.

 

I hope that makes sense. 🙂

Highlighted
Super User III
Super User III

Re: Adding and displaying multiple comments for same customer with a date and time stamp

@ttaylor 

The reason you are seeing an Invalid Argument Type is because ID has to exist in the contacts gallery.  I did not explictily say this earlier so I can understand your confusion.

 

However, from reading your post I can tell you want Notes to be tied to the organization instead.  I'd make the following changes:

 

  • Create a gallery containing contacts (galleryContacts)
  • Set the Items property of galleryContacts to the Contacts datasource
  • Create a gallery containing Notes (galleryNotes)
  • Set the Items property of galleryNotes to Filter(notes_sharepoint_list_datasource, galleryContacts.Selected.OrganizationID = OrganizationID)
  • (OrganizationID would be a column in your Contacts datasource containing the unique ID of the organization (i.e. vendor code)
  • (OrganizationID would ALSO be a column in your Notes datasource containing the unique ID of the organization (i.e. vendor code)
  • Now when the user clicks on a contact name it will display the contact's notes
  • Add a form (frm_addNote) in the state FormMode.New. Include any fields you require.
  • Add a submit button and use the following code:  Submit(frm_addNote); Refresh(your_notes_datasource_name_here).
  • Now when the user clicks Refresh the note will be submitted and the Gallery will be refreshed, showing the most recent note

 

Let me know if this helps!

 

Highlighted
Helper III
Helper III

Re: Adding and displaying multiple comments for same customer with a date and time stamp

I used a LookUp on Organization in my Notes list to get that info from my Contacts list. 

Highlighted
Super User III
Super User III

Re: Adding and displaying multiple comments for same customer with a date and time stamp

@ttaylor 

Is your datasource a Sharepoint list?  LookUp columns are considered to be a complex column type containing both an ID and a Value.  You probably want the value.  Here's how to do it by changing my code above.

 

Filter(notes_sharepoint_list_datasource, galleryContacts.Selected.OrganizationID = OrganizationID.value)
Highlighted
Helper III
Helper III

Re: Adding and displaying multiple comments for same customer with a date and time stamp

It is a SharePoint List. I used this Filter:

 

     Filter(GalleryNotes, GalleryContacts.Selected.OrganizationID = OrganizationID.Value)

 

and I'm still getting an invalid argument on my GalleryNotes table. 

 

From what I understand, by using a LookUp I don't need a unique Identifier in my tables, correct?

 

You have been so kind in helping me. I really appreciate it!

Highlighted
Super User III
Super User III

Re: Adding and displaying multiple comments for same customer with a date and time stamp

@ttaylor 

Maybe, its because we should change the Items property of the GalleryNotes to reference the SP List datasouce instead of a gallery:

 

Filter(notes_sharepoint_list_datasourceGalleryContacts.Selected.OrganizationID = OrganizationID.Value)

 

 

No problem.  We'll keep on plugging away at this.  I feel like the solution is within reach!

Highlighted
Helper III
Helper III

Re: Adding and displaying multiple comments for same customer with a date and time stamp

Sorry...no luck. Doesn't seem to like the OrganizationID:

 

Filter(Notes, GalleryOrgs.Selected.OrganizationID = OrganizationID.Value)

Highlighted
Dual Super User III
Dual Super User III

Re: Adding and displaying multiple comments for same customer with a date and time stamp

Hi @ttaylor 

 

Can you share more details about the schema of both the sharepoint list and their relationship?
 
You can use either Edit Form to update an existing record or create individual controls. If you can share more information about the requirements, then I might be able to help you with formula building.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (5,918)