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 / Insert comma between t...
Power Automate
Unanswered

Insert comma between two strings- json object

(0) ShareShare
ReportReport
Posted on by 8

Hi I'm a beginner in Power Automate and I am pulling my fields from a connector that uses json.  If two items are returned it puts them together like Donald DuckMickey Mouse with no space or comma in between them.  I'd like the output to appear as Donald Duck, Mickey Mouse.

cgrant88_1-1649279928731.png

The condition has this:  length(outputs('Get_each_gift_details')?['body/soft_credits'])

Then I get the constituent ID for the person and then the Name of the person.

The json is like this:

"soft_credits": [
{
"id": "123456",
"amount": {
"value": 10
},
"constituent_id": "0010",
"gift_id": "8888"
},
{
"id": "123333",
"amount": {
"value": 10
},
"constituent_id": "0011",
"gift_id": "8888"
}
]

Thanks for any help!

Carol

 

Categories:
I have the same question (0)
  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @cgrant88 

     

    Where is the name in that JSON? Not clearly understood your requirement. 

     

    If you want to put comma between two different strings and combine it then use contact() expression

     

    eg: concat('A', ',', 'B') 

     

    will output as A,B

  • v-jefferni Profile Picture
    on at

    Hi @cgrant88 ,

     

    The reason is you are appending the Names to a string variable. To achieve the goal, initialize an array variable and append all the Name to it within the loop, add a compose operator below the for each loop with its value set to below expression:

    join(variables('ArrayVariableName'), ',')

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • cgrant88 Profile Picture
    8 on at

     I've tried appending this to an array variable and it didn't work.  Here is the flow:

    cgrant88_0-1650055492704.png

    What happens is it accumulates everyone's soft credit names not just for that gift.

    Gift 1- Mickey Mouse

    Gift 2- Donald DuckDaisey Duck

    Gift 3- Goofy Dog

    My ending Compose with a join is:  Mickey Mouse, Donald DuckDaisey Duck, Goofy Dog

    All I want is for Gift 2 to be Donald Duck, Daisey Duck if there is more than one listed.

    The rest of the flow looks to see if there are gifts then if yes it pulls in other information about that one gift and loops through them.

    cgrant88_1-1650055826351.png

     

    I'm not sure who marked this as a solution and I'm also not sure where all the other comments are when I was working with Expiscornovus. 

     

     

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