cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tylacha
Helper I
Helper I

powerapp triggered flow

Hi, 

I am following the tutorial here for an appended comment solution: https://www.c-sharpcorner.com/article/display-appended-comments-version-history-from-sharepoint-list...

 

I am running into an issue where I am getting null values in my comments from when I update my form without entering notes.  How can I filter these out?

 

tylacha_0-1656600979627.png

 

Also, side question...  I have two screens for my form.  Edit and View.  Can a button not be clickable in view mode?  I can't seem to get it to work.

1 ACCEPTED SOLUTION

Accepted Solutions
TheRobRush
Super User
Super User

add a conditional loop in your forall to check if the item is null or not before appending your comment.

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!

View solution in original post

3 REPLIES 3
TheRobRush
Super User
Super User

what is the control type displaying those comments, and what does its items or text property contain code wise.

If it is a gallery, could you also share what the source column containing the comments looks like

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!
tylacha
Helper I
Helper I

I added a link to the tutorial in my original post, the comments are retreived from an HTTP request, then parsed with json, finally combined with concat to a single variable in an apply for each .  I'm very new to powerapps, so hopefully I am explaining properly.  Here is the snipet from the tutorial where everything is coming together.  

 

 

  • Add an action to “Parse JSON”.
tylacha_0-1656605896616.png

 

  • Add Content, select Body as result there. We need to parse a comment from the value. So, we will add the following thing as schema.
tylacha_1-1656605896632.png

 

 
  1. {  
  2.     "type""object",  
  3.     "properties": {  
  4.         "value": {  
  5.             "type""array",  
  6.             "items": {  
  7.                 "type""object",  
  8.                 "properties": {  
  9.                     "Comment": {  
  10.                         "type""string"  
  11.                     }  
  12.                 }
  13.             }  
  14.         }  
  15.     }  
  16. }  
  • Click an action “Compose” so that “Apply to each” will be created automatically.
tylacha_2-1656605896727.png

 

  • In Compose, create the below formula.
tylacha_3-1656605896740.png

 

 
  1. formatdatetime(items('Apply_to_each')['Modified'],'MM/dd/yyyy hh:mm tt')    
  • Now, add an action “Append to string variable”.
tylacha_4-1656605896750.png

 

In name, select the already created variable named “AppendComment”.

 
  1. concat('<div style="margin-bottom:5px;">',items('Apply_to_each')['Author']  
  2. ['LookupValue'],' (<span style="color: rgb(3, 131,  
  3. 135)">',outputs('Compose'),'</span>)','',items('Apply_to_each')  
  4. [variables('ColumnName')],'</div>')  
TheRobRush
Super User
Super User

add a conditional loop in your forall to check if the item is null or not before appending your comment.

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (4,065)