cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
rburns05
Level: Powered On

Need to remove 'Apply to each' or work around it

I've set up an automated flow that initiates 'When an item is created' in a SharePoint list, which I'll refer to as List 1.


The action I've added is to 'Create Item' in a separate list, which I'll refer to as List 2.
There’s a Choice field in List 1 labeled ‘Data Retrieval/Sourcing.’ The list allows for multiple selections in this field. I’d like to have the responses to this field populate into a separately named field in List 2 labeled ‘Customer Data Requirements.’ ‘Customer Data Requirements’ is a multiple line text field. If someone selected multiple options on the ‘Data Retrieval/Sourcing’ question, I would expect that they would appear one after the other, possibly separated by a comma in ‘Customer Data Requirements’ if the flow worked as I intended.


When I went to add ‘Data Retrieval Sourcing’ as dynamic content to the ‘Customer Data Requirements’ field in List 2, an Apply to Each box overlapped the entire ‘Create Item’ space I was working within. I’m not familiar with this feature but it only appears when I insert a multi-choice field as dynamic content into another field. I’m not interested in using it and I’d like to find a way to work around it if there’s no way to remove it entirely.
When I saved the flow and submitted an entry with two distinct choices on ‘Data Retrieval/Sourcing,’ two entries were created in List 2 with the same ID. The only difference, as you might guess, were the responses to the ‘Data Retrieval/Sourcing’ question. The responses were separated out, not joined together in one entry as I intended.


I think my options are to 1) somehow figure out how to remove ‘Apply to Each’ from appearing or 2) figure out how to work around ‘Apply to Each’ so that I get the intended result of combining the responses from the multi-choice fields into one entry. I should also note that the ‘Data Retrieval/Sourcing’ field isn’t the only multi-choice one I’m working with, so I’d need to be able to create a solution which would work for other list fields with the same column type as well.
Any advice or help would be appreciated.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: Need to remove 'Apply to each' or work around it

@rburns05 you can do this as follows. First we have list 1 with a column named Data Retrieval/Sourcing which is a Choice column allowing multiple selections:

0-SP-list1.png

In the flow the SharePoint trigger is When a new item is created.

The first action is to initialize a string variable.

Next we need to add a Parse JSON action. We need this because the Choice column gets brought into the flow as an object with lots of other info. We don't want that other info, we just want the value property formatted as a string:

1-trigger-var-json.pngThe syntax for the JSON code is:

 

 

{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "Value": {
                "type": "string"
            }
        },
        "required": [
            "Value"
        ]
    }
}

 

 

We then add an append to string variable and select Value from the Parse JSON section of the dynamic content. Add a space after Value.

It will wrap it in an apply to each but don't worry about that, it's expected.

Finally, the new item is created in List 2 and the Customer Data Requirements column is populated by the variable. 

2-append-create.png

 The result in List 2 is that only 1 item is created and the items are separated by the space you added earlier.

3-SP-list2.png

 Come back with any questions about this.

Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

View solution in original post

Community Support Team
Community Support Team

Re: Need to remove 'Apply to each' or work around it

 

Hi @rburns05 ,

 

Please try to refer to the following method to configure Flow.

65.PNG66.PNG

 

Best Regards,

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

View solution in original post

5 REPLIES 5
Super User
Super User

Re: Need to remove 'Apply to each' or work around it

@rburns05 

Hi there.  Check out this video from Elaiza Benitez, I think it might help.

 

 

Keep us posted.

-Ed-

 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

rburns05
Level: Powered On

Re: Need to remove 'Apply to each' or work around it

Thank you for your response. Unfortunately, I wasn't able to make the connection between the video and the issue I'm experiencing. I'll keep re-watching/retrying but I haven't had any luck so far

Super User
Super User

Re: Need to remove 'Apply to each' or work around it

@rburns05 you can do this as follows. First we have list 1 with a column named Data Retrieval/Sourcing which is a Choice column allowing multiple selections:

0-SP-list1.png

In the flow the SharePoint trigger is When a new item is created.

The first action is to initialize a string variable.

Next we need to add a Parse JSON action. We need this because the Choice column gets brought into the flow as an object with lots of other info. We don't want that other info, we just want the value property formatted as a string:

1-trigger-var-json.pngThe syntax for the JSON code is:

 

 

{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "Value": {
                "type": "string"
            }
        },
        "required": [
            "Value"
        ]
    }
}

 

 

We then add an append to string variable and select Value from the Parse JSON section of the dynamic content. Add a space after Value.

It will wrap it in an apply to each but don't worry about that, it's expected.

Finally, the new item is created in List 2 and the Customer Data Requirements column is populated by the variable. 

2-append-create.png

 The result in List 2 is that only 1 item is created and the items are separated by the space you added earlier.

3-SP-list2.png

 Come back with any questions about this.

Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

View solution in original post

Community Support Team
Community Support Team

Re: Need to remove 'Apply to each' or work around it

 

Hi @rburns05 ,

 

Please try to refer to the following method to configure Flow.

65.PNG66.PNG

 

Best Regards,

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

View solution in original post

rburns05
Level: Powered On

Re: Need to remove 'Apply to each' or work around it

This worked perfectly and was exactly what I needed. Thank you!

Helpful resources

Announcements
firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (10,207)