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 / Compose not working in...
Power Automate
Unanswered

Compose not working in a 'Apply to each'

(0) ShareShare
ReportReport
Posted on by 32

I have a flow that takes information and pictures from a Power App and puts it through a JSON. I then extract information from that. I'm having issues with using composes. I have 4 composes that take apart a link that is coming from the Power App. Those pieces are then used to locate a SharePoint location and move a folder there. The link isn't changing at all and stays the same for each iteration.

 

For more background, the flow takes pictures from the power app and puts them in a folder that has a number. The flow then checks to see if there is a SharePoint link that is associated with the picture. If there is, then it will take that folder that is associated with the picture and move it to the SharePoint location. There could be a different SharePoint link for each picture. I want to be able to move each folder that houses those pictures to the different locations.

 

These are the codes that are used in each one.

 

Compose 6: 

split(body('Parse_JSON')[0].SharePointLink, 'https://companyname.sharepoint.com/sites/')
 
Compose 7: 
split(outputs('Compose_6')[1], '/')
 
Compose 8: 
concat('https://companyname.sharepoint.com/sites/', outputs('Compose_7')[0], '/')
 
Compose 5: 
concat('/', split(body('Parse_JSON')[0].SharePointLink, outputs('Compose_8'))[1])

 

PowerAppsUser8_2-1673044913884.png

 

PowerAppsUser8_1-1673044290076.png

 

 

 

Categories:
I have the same question (0)
  • Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at

    @PowerAppsUser8  Compose is giving output based on used expression. What you are trying to achieve here? Pls explain.

    Please 'Thumbs Up' the posts that helped you and 'Accept as Solution' if my post answered your question.

    @Hardesh /Gopenly.in

  • PowerAppsUser8 Profile Picture
    32 on at

    @Hardesh15 

     

    TLDR; I want compose to take a different SharePoint link that is associated with a different picture instead of keeping the first link that goes through. Currently, compose is only taking the first SharePoint link and not changing. The compose is in a apply to each.

     

    I'll try my best to explain. Let's take an example that you have 2 pictures that you want to move each to a different SharePoint location. You use power apps to take those 2 pictures and a SharePoint link is associated with each picture in the power app. Each picture has its own SharePoint link. I want the flow to be able to move each picture to the location that is attached to the picture.

     

    I'll try to map it out

     

    Picture A has SharePoint link "A"

    Picture B has SharePoint link "B"

     

    Flow takes both pictures > Creates folder for Picture A called "A" and then creates folder for Picture B called "B"

     

    Flow then takes SharePoint link from picture A and moves Folder "A" to that SharePoint link. Same with picture "B"

     

    That's basically everything. I have the compose in a apply to each. I figured that the first picture (picture A) will go through the flow and the compose will take the SharePoint link from picture A and move Folder "A" to that location. Then picture B will move through the flow and compose will take picture B's SharePoint link instead of keeping picture A's.

     

    Does this make sense? Let me know where you are confused, and I'll try to reword.

     

  • Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at

    @PowerAppsUser8 I understand what you are trying to achieve here. Please share complete flow in edit mode along with details of the compose and output. Pls name it properly.

    Please 'Thumbs Up' the posts that helped you and 'Accept as Solution' if my post answered your question.

    @Hardesh /Gopenly.in

     

  • PowerAppsUser8 Profile Picture
    32 on at

    @Hardesh15 Let me know if you need me to explain anything. The details of the compose are in the main post, but I'll paste it down here. The picture is only missing 2 parts of the flow which is just the parsing of JSON and creating the folders for pictures and moving the pictures into the folder. That works fine.

     

    These are the codes that are used in each one.

     

    Compose 6: 

    split(body('Parse_JSON')[0].SharePointLink, 'https://companyname.sharepoint.com/sites/')
     
    Compose 7: 
    split(outputs('Compose_6')[1], '/')
     
    Compose 8: 
    concat('https://companyname.sharepoint.com/sites/', outputs('Compose_7')[0], '/')
     
    Compose 5: 
    concat('/', split(body('Parse_JSON')[0].SharePointLink, outputs('Compose_8'))[1])
     
    PowerAppsUser8_1-1673287606501.png

     

     

    PowerAppsUser8_2-1673287651687.png

     

     

  • PowerAppsUser8 Profile Picture
    32 on at

    I'm still struggling with this flow if anyone can help.

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 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard