cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Advocate II
Advocate II

Building an array to pull all the comments from a trello card

It would seem that Arrays or the solution to my issue has become my Kryptonite as I have not been able to figure out how to pull all the comments from my Trello Card and put them into a New Trello Card Description.  If there is a know solution, would @jlevesque be able to create a video on Youtube for this.  And  the solution be provided here. Any assistance would be appreciated.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Dual Super User III
Dual Super User III

HI @PMavrich 

 

Please have a look at the screenshot below:

tersrs.png

This lists the comments of a card puts them into an array and finally while creating a new card adds the comments to the description separated by a ';'. 

expression used for the card description:

join(variables('test'),' ;')

Here, test is the array variable I created. 

 

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!

View solution in original post

@PMavrich 

 

Please have a look at the flow screenshot below:flotret.png

Expression used in the append to array variable next to Date:

formatDateTime(items('Apply_to_each')?['date'],'dd/MM/yyyy')

You can format the date time according to your requirements. 

In the initialise variable 2, hit an enter and save it. it should look like as shown in the screenshot. 

Expression used in the card description

join(variables('dd'),variables('space'))

We are using the variable 2 to join the array items and create the new line. 

 

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!

View solution in original post

13 REPLIES 13
Dual Super User III
Dual Super User III

HI @PMavrich 

 

Please have a look at the screenshot below:

tersrs.png

This lists the comments of a card puts them into an array and finally while creating a new card adds the comments to the description separated by a ';'. 

expression used for the card description:

join(variables('test'),' ;')

Here, test is the array variable I created. 

 

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!

View solution in original post

@yashag2255 

 

It still returns the last comment.  There are 3 comments ...

 

List Comments For a card

 

[

{

   "id": "5cf7cf322d015b1dfe48b83c",

   "idMemberCreator": "5cd32a62ac66ba3080f8b449",

   "type": "commentCard",

   "date": "2019-06-05T14:18:26.948Z",

   "limits": {

     "reactions": {

       "perAction": {

         "status": "ok",

         "disableAt": 1000,Capture.JPG

         "warnAt": 900

       },

       "uniquePerAction": {

         "status": "ok",

         "disableAt": 17,

         "warnAt": 16

       }

     }

   },

   "memberCreator": {

     "id": "5cd32a62ac66ba3080f8b449",

     "avatarHash": null,

     "avatarUrl": null,

     "fullName": "Patricia Mavrich",

     "idMemberReferrer": null,

     "initials": "PM",

     "nonPublic": {},

     "nonPublicAvailable": false,

     "username": "patriciamavrich"

   },

   "text": "This has to work"

},

{

   "id": "5cf7cf247fa4e242f0a83c90",

   "idMemberCreator": "5cd32a62ac66ba3080f8b449",

   "type": "commentCard",

   "date": "2019-06-05T14:18:12.027Z",

   "limits": {

     "reactions": {

       "perAction": {

         "status": "ok",

         "disableAt": 1000,

         "warnAt": 900

       },

       "uniquePerAction": {

         "status": "ok",

         "disableAt": 17,

         "warnAt": 16

       }

     }

   },

   "memberCreator": {

     "id": "5cd32a62ac66ba3080f8b449",

     "avatarHash": null,

     "avatarUrl": null,

     "fullName": "Patricia Mavrich",

     "idMemberReferrer": null,

     "initials": "PM",

     "nonPublic": {},

     "nonPublicAvailable": false,

     "username": "patriciamavrich"

   },

   "text": "Testing comment transfer"

},

{

   "id": "5cf7cf1a85f5c02fc6be8b73",

   "idMemberCreator": "5cd32a62ac66ba3080f8b449",

   "type": "commentCard",

   "date": "2019-06-05T14:18:02.96Z",

   "limits": {

     "reactions": {

       "perAction": {

         "status": "ok",

         "disableAt": 1000,

         "warnAt": 900

       },

       "uniquePerAction": {

         "status": "ok",

         "disableAt": 17,

         "warnAt": 16

       }

     }

   },

   "memberCreator": {

     "id": "5cd32a62ac66ba3080f8b449",

     "avatarHash": null,

     "avatarUrl": null,

     "fullName": "Patricia Mavrich",

     "idMemberReferrer": null,

     "initials": "PM",

     "nonPublic": {},

     "nonPublicAvailable": false,

     "username": "patriciamavrich"

   },

   "text": "Testing Comment transfer\n"

}

]

 

@yashag2255 

 

List Comments For a card

 

[

{

   "id": "5cf7cf322d015b1dfe48b83c",

   "idMemberCreator": "5cd32a62ac66ba3080f8b449",

   "type": "commentCard",

   "date": "2019-06-05T14:18:26.948Z",

   "limits": {

     "reactions": {

       "perAction": {

         "status": "ok",

         "disableAt": 1000,

         "warnAt": 900

       },

       "uniquePerAction": {

         "status": "ok",

         "disableAt": 17,

         "warnAt": 16

       }

     }

   },

   "memberCreator": {

     "id": "5cd32a62ac66ba3080f8b449",

     "avatarHash": null,

     "avatarUrl": null,

     "fullName": "Patricia Mavrich",

     "idMemberReferrer": null,

     "initials": "PM",

     "nonPublic": {},

     "nonPublicAvailable": false,

     "username": "patriciamavrich"

   },

   "text": "This has to work"

},

{

   "id": "5cf7cf247fa4e242f0a83c90",

   "idMemberCreator": "5cd32a62ac66ba3080f8b449",

   "type": "commentCard",

   "date": "2019-06-05T14:18:12.027Z",

   "limits": {

     "reactions": {

       "perAction": {

         "status": "ok",

         "disableAt": 1000,

         "warnAt": 900

       },

       "uniquePerAction": {

         "status": "ok",

         "disableAt": 17,

         "warnAt": 16

       }

     }

   },

   "memberCreator": {

     "id": "5cd32a62ac66ba3080f8b449",

     "avatarHash": null,

     "avatarUrl": null,

     "fullName": "Patricia Mavrich",

     "idMemberReferrer": null,

     "initials": "PM",

     "nonPublic": {},

     "nonPublicAvailable": false,

     "username": "patriciamavrich"

   },

   "text": "Testing comment transfer"

},

{

   "id": "5cf7cf1a85f5c02fc6be8b73",

   "idMemberCreator": "5cd32a62ac66ba3080f8b449",

   "type": "commentCard",

   "date": "2019-06-05T14:18:02.96Z",

   "limits": {

     "reactions": {

       "perAction": {

         "status": "ok",

         "disableAt": 1000,

         "warnAt": 900

       },

       "uniquePerAction": {

         "status": "ok",

         "disableAt": 17,

         "warnAt": 16

       }

     }

   },

   "memberCreator": {

     "id": "5cd32a62ac66ba3080f8b449",

     "avatarHash": null,

     "avatarUrl": null,

     "fullName": "Patricia Mavrich",

     "idMemberReferrer": null,

     "initials": "PM",

     "nonPublic": {},

     "nonPublicAvailable": false,

     "username": "patriciamavrich"

   },

   "text": "Testing Comment transfer\n"

}

 

@yashag2255 

 

List Comments For a card

 

[

{

   "id": "5cf7cf322d015b1dfe48b83c",

   "idMemberCreator": "5cd32a62ac66ba3080f8b449",

   "type": "commentCard",

   "date": "2019-06-05T14:18:26.948Z",

   "limits": {

     "reactions": {

       "perAction": {

         "status": "ok",

         "disableAt": 1000,

         "warnAt": 900

       },

       "uniquePerAction": {

         "status": "ok",

         "disableAt": 17,

         "warnAt": 16

       }

     }

   },

   "memberCreator": {

     "id": "5cd32a62ac66ba3080f8b449",

     "avatarHash": null,

     "avatarUrl": null,

     "fullName": "Patricia Mavrich",

     "idMemberReferrer": null,

     "initials": "PM",

     "nonPublic": {},

     "nonPublicAvailable": false,

     "username": "patriciamavrich"

   },

   "text": "This has to work"

},

{

   "id": "5cf7cf247fa4e242f0a83c90",

   "idMemberCreator": "5cd32a62ac66ba3080f8b449",

   "type": "commentCard",

   "date": "2019-06-05T14:18:12.027Z",

   "limits": {

     "reactions": {

       "perAction": {

         "status": "ok",

         "disableAt": 1000,

         "warnAt": 900

       },

       "uniquePerAction": {

         "status": "ok",

         "disableAt": 17,

         "warnAt": 16

       }

     }

   },

   "memberCreator": {

     "id": "5cd32a62ac66ba3080f8b449",

     "avatarHash": null,

     "avatarUrl": null,

     "fullName": "Patricia Mavrich",

     "idMemberReferrer": null,

     "initials": "PM",

     "nonPublic": {},

     "nonPublicAvailable": false,

     "username": "patriciamavrich"

   },

   "text": "Testing comment transfer"

},

{

   "id": "5cf7cf1a85f5c02fc6be8b73",

   "idMemberCreator": "5cd32a62ac66ba3080f8b449",

   "type": "commentCard",

   "date": "2019-06-05T14:18:02.96Z",

   "limits": {

     "reactions": {

       "perAction": {

         "status": "ok",

         "disableAt": 1000,

         "warnAt": 900

       },

       "uniquePerAction": {

         "status": "ok",

         "disableAt": 17,

         "warnAt": 16

       }

     }

   },

   "memberCreator": {

     "id": "5cd32a62ac66ba3080f8b449",

     "avatarHash": null,

     "avatarUrl": null,

     "fullName": "Patricia Mavrich",

     "idMemberReferrer": null,

     "initials": "PM",

     "nonPublic": {},

     "nonPublicAvailable": false,

     "username": "patriciamavrich"

   },

   "text": "Testing Comment transfer\n"

}

 

hey! can you share a screenshot of your flow? 

This is my flowThis is my flow@yashag2255 

@PMavrich 

 

You are creating the card inside of the "apply to each loop" This will not only create multiple cards but have the current card as text. Move that Create a card action outside of the loop and it should work. 

@yashag2255 

 

I need all the comments to populate the bottom of one card  As a series of information.

@PMavrich  Yes. The append to array action collects all the comments into the array and form one. With that as a collection, we are converting it to a string with the Join function and putting it in the description. Did you test it out by movig the create card action outside the loop?

ok, it works

 

now I need to add name and date

 

Date

Name

Comment 

 

as the structure... How would I be able to do that piece.

 

 

Hey @PMavrich 

 

Can you share more details on that? Name Date and comments from where? Is it from the source card? If you could share more details, I might be able to assist you better. 

 

Thanks, 

@yashag2255 

 

It is from the same source card.  It is the Date the comments were left and the person who left the comment.

@PMavrich 

 

Please have a look at the flow screenshot below:flotret.png

Expression used in the append to array variable next to Date:

formatDateTime(items('Apply_to_each')?['date'],'dd/MM/yyyy')

You can format the date time according to your requirements. 

In the initialise variable 2, hit an enter and save it. it should look like as shown in the screenshot. 

Expression used in the card description

join(variables('dd'),variables('space'))

We are using the variable 2 to join the array items and create the new line. 

 

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!

View solution in original post

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.

Top Solution Authors
Top Kudoed Authors
Users online (9,748)