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 / Power Apps issue getti...
Power Apps
Unanswered

Power Apps issue getting values from SharePoint List column

(0) ShareShare
ReportReport
Posted on by 18

Hi !
I have a Power App that at the very end, it prints four columns. I am requested to add a fifth column. So in the interface, under PrintScreen, under DailyQCGallery, I add a text label and I call it CommentsLabel. I added code (well I basically copied code that was from the fourth column) into this CommentsLabel. And I only changed one thing in the code. It is at the very end where the particular needed SharePoint column is listed (that I need to pull the value from). I just substituted the name of the SharePoint column - which is Comment, into the code. But Power Apps doesn't like this. It gives this error message: Invalid argument type. Cannot use unknown values in this context. The '.' operator cannot be used on text values.
 
So since the formula in the 4th column works - I was trying to see what would be a difference. The 4th column gets a value from the SP list column that is a Choice. My fifth column
pulls from the SP Comment column which is multiple lines of text (also that Comment column uses enhanced rich text - not sure that rich text is needed here, but it is what it is).
I tried to copy that Comment column and its values to a new column, so I can mess and do stuff with this copied column that I can always undo. I made this new column a calculated column - and chose the Comment column to get its values from. When I did that - a new screen just pops up and just says "error" and the screen I was working in disappears.
 
Anyway - how can I correct the code to pull into the label, the values in thatare in the SharePoint List column (Comment)?  Or can this even be done? Below is the code.
 
If(Month(DateAdd(_firstDayOfMonth,ThisItem.Value, TimeUnit.Days))= MonthSelected,LookUp(QCArray, 'QC Type'.Value = "Daily" And DateNumber = ((Year(DateAdd(_firstDayOfMonth,ThisItem.Value, TimeUnit.Days))*10000)+(Month(DateAdd(_firstDayOfMonth,ThisItem.Value, TimeUnit.Days))*100)+(Day(DateAdd(_firstDayOfMonth,ThisItem.Value, TimeUnit.Days))))).Comment.Value)
I have the same question (0)
  • Verified answer
    vipuljain03 Profile Picture
    647 Super User 2025 Season 2 on at
    I am assuming Comments field to be multiple line of text field in SharePoint list in your case.
     
    Choice fields returns records with .Value, however a Multiple Lines of Text field is returned as plain text or HTML-formatted text, depending on the settings.
     
    So, in your code at the end you are using Comment.Value which will not work.
    Instead, use just .Comment at the end.
    If(
        Month(DateAdd(_firstDayOfMonth, ThisItem.Value, TimeUnit.Days)) = MonthSelected, 
        LookUp(
            QCArray, 
            'QC Type'.Value = "Daily" And 
            DateNumber = ((Year(DateAdd(_firstDayOfMonth, ThisItem.Value, TimeUnit.Days)) * 10000) + 
                         (Month(DateAdd(_firstDayOfMonth, ThisItem.Value, TimeUnit.Days)) * 100) + 
                         (Day(DateAdd(_firstDayOfMonth, ThisItem.Value, TimeUnit.Days)))
            )
        ).Comment
    )
    ------------------------------------------------
    If this reply helped you, please mark this reply as suggested answer ✔️ and give it a like to help others in the community find the answer too!
    Thanks,
    Vipul
  • KM-02041615-0 Profile Picture
    18 on at
    Thank you for the quick response !!  This suggested change works, but.....it is pulling in weird text. You can see it in the attached file. In the attached, you can see where the arrow is, it is pulling in weird text - where in this situation you should see the word "Good" in the column.   I ran the app a few more times - while simultaneously looking at the values of the comment column in the SP list library.  Everywhere that there should be a comment appearing in the Comment column, the app shows something like this:
     
    class="ExternalClass9FA4..........
     
    I am wondering if that is because the Comment column (in Edit column) in the list, has needless "Enhanced Rich Text" set to On.   The reason I was going to copy this column in the list, as I mentioned above, was to see if I could do some type of workaround where I turned off that Enhanced Rich Text - but as I copied, a new screen appeared that said "error", and my current screen disappeared. I had read somewhere that if you turn off Enhanced Rich Text, you cannot undo it (which actually may be okay here).
     
    Maybe this is not the issue. Let me know your thoughts. Your time with this is very much appreciated.
  • ronaldwalcott Profile Picture
    3,847 Super User 2025 Season 2 on at
    Enhanced rich text will show in that manner as it is not plain text but includes formatting options such as bold, italics, underlining, font styles, colors, and even lists or tables.
  • vipuljain03 Profile Picture
    647 Super User 2025 Season 2 on at
    @KM-02041615-0 - 
    I am glad to know my solution helped you.
     
    Yes, you are right. This formatting is because of Comments field setting as enhanced rich textbox which allows bold, italic etc. formatting features as compared to plain text setting.
     
    -----------------------------------
    If this reply helped you, please mark this reply as suggested answer ✔️ and give it a like to help others in the community find the answer too!
    Thanks,
    Vipul
  • KM-02041615-0 Profile Picture
    18 on at
    Thanks again for your answers. So what happens when I turn off the "Enhanced Rich Text" radio button via the edit column for my new Comment column? And will that result in the value for that column appearing correctly? Is this the solution? I don't mind if I no longer see any values that are bolded, or underlined, etc., because people are just entering simple text for this field. But those column entries are valuable, and I do not want to mess them up.
  • KM-02041615-0 Profile Picture
    18 on at
    So to clear up this thread....I decided to replace the label control with the HTML Text Control (I did not change the Enhanced Rich Text option on the SharePoint column). This "works" but now I have a new issue that I will do a separate post on. Thanks to all who responded here.

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard