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 Automate / Remove ending comma fr...
Power Automate
Answered

Remove ending comma from concatenated emails

(0) ShareShare
ReportReport
Posted on by 272

I a trying to use an http request to send emails to a group but I can't figure out how to remove the extra comma on the end.  Here's how I created it.

 

I grab the users from the group and Parse the JSON. The d.results looks like this @{body('Send_an_HTTP_request_to_SharePoint_3')?['d']?['results']}

theisogunro_1-1644461607470.png

 

I then loop through the body and grab the appended emails and store it in the varGovEmail

theisogunro_2-1644461901339.png

I then use it in my email

theisogunro_3-1644462161586.png

 

but I get an error because of the last ",".

theisogunro_4-1644462382046.png

 

How can I remove that last comma?  Thanks!

 

Categories:
I have the same question (0)
  • Verified answer
    Mister_Shaik Profile Picture
    1,008 on at

    Hi @theisogunro ,

     

    You can use a slice expression on the variable to remove the last comma,

    slice(variables('varGovEmail'),0,sub(length(variables('varGovEmail')),1))

     

    I'm basically slicing the string from index 0 to string length-1. Use this expression in the "Send an HTTP action.." and replace the variable with this expression in To property. I've also tested it in a flow, works perfectly!

     

    Hope this helps 🙂

     

    Kind Regards,

    Shaik Sha
    ________________________________________________________________________

    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

     

     

  • theisogunro Profile Picture
    272 on at

    That worked! The last comma was removed but I get null.  I will accept your solution and post the new problem.  Thank you!

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 Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard