cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

Coming Soon: T-shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

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

Power Platform World Tour

Find out where you can attend!

Top Solution Authors
Top Kudoed Authors
Users online (6,098)