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 / Viewing Messages in a ...
Power Apps
Unanswered

Viewing Messages in a Gallery

(0) ShareShare
ReportReport
Posted on by

Hi Experts,

 

I have a gallery that shows items raised in a sharepoint list, on the arrow on the gallery I have

Set(varRecord, ThisItem)

I then have a rich text editor box so that new comments can be entered and patched to an item in the sharepoint list via a button, the button's code is

Set(
	varRecord,
	Patch(
		CustomerServices,
		varRecord,
		{Messages: varRecord.Messages & "***" & CountRows('Messages Gallery'.AllItems) + 1 & " - " & User().FullName & " - " & Now() &
":<br>" & RichTextEditor1.HtmlText}
	)
);
Reset(RichTextEditor1)

I then have another gallery which I'd like to be able to see all of the previous messages that have been put on the select item from the first gallery, I assumed the code should be the below but it's telling me there's an error

Filter( Split(varRecord.Messages, "***"), !IsBlank(Result))

I've put a HtmlText input inside the 2nd gallery and entered the below in HtmlText but again getting an error, can you advise where i'm going wrong please?

ThisItem.Result
Categories:
I have the same question (0)
  • janson Profile Picture
    62 on at

    What is the error you are getting? Is Messages a text column in the CustomerServices list? Btw, do you really need to use the global variable varRecord? Can't you just refer the record directly?

  • Dave-ITMan Profile Picture
    on at

    Hi @janson 

    Yes Messages is a multiline text column in the sharepoint list. 

     

    The errors i'm getting on the Items for Messages Gallery are "the function IsBlank has some invalid arguments" and "Name isn't valid, 'Result' isn't recognized 

     

    And the errors i'm getting on the HTMLText of the HtmlText input are "Name isn't valid, 'Result' isn't recognized.

     

    The reason for using the variable varRecord is because I wanted to group all of the messages together but be able to display them as individual results in the last gallery so that you can expand them individually. I used the below video for reference from 6minutes and 15seconds in as that's exactly what i'm looking to achieve but just doesn't work for me

    https://www.youtube.com/watch?v=dre1E9GiDJM 

  • AaronKnox Profile Picture
    514 Super User 2024 Season 1 on at

    Hi @Dave-ITMan ,

    Split() returns a single column table with Value as the name of the column, not Result.  !IsBlank() should not be used in Filter() as it doesn't delegate.  Further, I'm not getting valid results in testing with <> Blank(), but "" seems to work fine.  Therefore, the solution is to change Result to Value and replace !IsBlank() with <> "":

    Filter( Split(varRecord.Messages, "***"), Value <> "")

     

    Example from my testing:

    CaptureW2a.JPG CaptureW2.JPG

     

    @janson makes a good point:  Consider using gallery.selected instead of assigning that record to a variable.  So instead of this code for the Arrow.OnSelect:  Set(varRecord, ThisItem), change that to:

    Select(Parent)

    And then any code that follows this selection made by the user can simply use gallery.selected.   In most scenarios, this eliminates the need for a global variable.

     

    Hope this helps!

    Aaron

  • Dave-ITMan Profile Picture
    on at

    Hi @AaronKnox 

     

    Thank you for this and the level of detail. That has resolved the first error but I still have the error on the HtmlText input box within the second gallery to show the previous messages (where you have it split as testing1 - testing6), what formula do I need to use for that box please?  

  • AaronKnox Profile Picture
    514 Super User 2024 Season 1 on at

    Hi @Dave-ITMan ,

    Does this formula work?

     ThisItem.Value

    Without knowing the 2ndGallery.Items property, I can only guess. 

    Thanks,

    Aaron

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 401 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard