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 / How to take the result...
Power Apps
Unanswered

How to take the results of a loop and out put into a single message

(0) ShareShare
ReportReport
Posted on by

I am creating a powerapp that collects data within a loop then posts the output to a Teams channel.  My question is there a way to wait for the loop to finish and then post the output all at once to Teams instead of once for each loop?

 

Thanks!

Categories:
I have the same question (0)
  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @Anonymous,

     

    Is joining all of your data with a new line as a seperator and sending that message to Teams a viable solution? E.g:

    Loop1 text
    Loop2 text
    Loop3 text

     

    In this case, instead of using the Teams message function within your ForAll() use it outside the forall combined with the Concat() function. Since I don't have your code, I will explain it with a fictive example below:

     

    Concat(
     ForAll(
     [
     "Loop1 Text",
     "Loop2 Text",
     "Loop3 Text"
     ],
     Value
     ),
     Value,
     Char(10)
    )

    The example above will combine all values from my datasource (array) with an enter and return it as a string value. The end result will be the text shown in the first code block. This could be used as the content of a MicrosoftTeams.PostMessageToChannelV3 action. 

     

    If you want to use the concat, you will have to change the ForAll and most likely the Value references as well.

     

    I hope this helps!

  • Community Power Platform Member Profile Picture
    on at

    Thank you for the info.  Is there a way to handle if the number of loops is dynamic and changes?

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