Skip to main content

Notifications

Community site session details

Community site session details

Session Id : fBpsmDwQkVr5fJBIxt7bCv
Power Apps - Power Apps Pro Dev & ISV
Answered

Power Apps issue getting values from SharePoint List column

Like (0) ShareShare
ReportReport
Posted on 2 Apr 2025 16:54:31 by 12

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)
  • KM-02041615-0 Profile Picture
    12 on 04 Apr 2025 at 19:44:30
    Power Apps issue getting values from SharePoint List column
    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.
  • KM-02041615-0 Profile Picture
    12 on 03 Apr 2025 at 13:34:33
    Power Apps issue getting values from SharePoint List column
    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.
  • vipuljain03 Profile Picture
    415 on 03 Apr 2025 at 10:50:12
    Power Apps issue getting values from SharePoint List column
    @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
  • ronaldwalcott Profile Picture
    2,082 on 02 Apr 2025 at 20:58:48
    Power Apps issue getting values from SharePoint List column
    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.
  • KM-02041615-0 Profile Picture
    12 on 02 Apr 2025 at 19:34:43
    Power Apps issue getting values from SharePoint List column
    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.
  • Verified answer
    vipuljain03 Profile Picture
    415 on 02 Apr 2025 at 17:34:15
    Power Apps issue getting values from SharePoint List column
    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

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,518 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,692 Most Valuable Professional

Leaderboard