I am using FOR EACH action in logic app and have 5 images in array and want to save each image with different name in blob.

Shubham Chougule 21 Reputation points
2022-11-09T04:06:54.533+00:00

What expression can be used to change the name of file for each loop?

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,542 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. VenkateshDodda-MSFT 24,951 Reputation points Microsoft Employee Moderator
    2022-11-09T08:24:18.157+00:00

    @Shubham Chougule Thank you for reaching out to Microsoft Q&A. To test this, I have created a 2 storage accounts (source, destination) uploads around 5-7 images as blobs in source account and using the foreach loop created a new blob in destination account.

    You can add the create_blob action inside the For_each Loop. If the name for the newly created blob is an " append of existing blob name + constant string" across all the blobs, then you can add this value "new_blob_@{item().Name}" to blob name parameter similar to as shown below.

    258672-image.png

    and the output sample as shown below

    258682-image.png

    • If you want the name of the new blob with "constant string + guid value" then you can use the guid() function in the blob name parameter to create_blob action with value constantstring_@{guid()}.png
    • If you want the name of the new blob with the "concatenate of iteration index number + constant string" then you can use the IterationIndexes function and this function can be used inside the until loop only.

    Feel free to reach back to me if you have any queries on this.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.