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

initialize variable always forming an 'apply to each'

Hi

 

I have a flow that requests the user to input a start and end date. I and trying to populate a SQL server with documents between the requested dates.

 

So I have the button trigger, requesting StartDate and EndDate. Then I have 'get files (properties only)' which directs to a particular library. After this I need to initialize several variables because I need them for lookup values within the SQL database. 

 

Every time I initialize a variable and select a field from the SharePoint properties the variable immediately becomes nested in an an 'apply to each' - but this isn't allowed. So I can't save or do anything afte rthis point. 

 

Is there a way to initialize these variables? I would expect the trigger to find several hundred documents, so it needs to be get files rather than get file, but completely stuck at the moment. 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: initialize variable always forming an 'apply to each'

Hi @Back2Basics

You will need to use trhe initialize varibale action near the top of your flow. Do not set the value!

then later on use a set variable where you can set the variable to the value that you need.

 

The reasson for the Apply to each is added is beciuase the data that you are using is an array.

View solution in original post

1 REPLY 1
Super User
Super User

Re: initialize variable always forming an 'apply to each'

Hi @Back2Basics

You will need to use trhe initialize varibale action near the top of your flow. Do not set the value!

then later on use a set variable where you can set the variable to the value that you need.

 

The reasson for the Apply to each is added is beciuase the data that you are using is an array.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,383)