Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Can you preprocess a variable to use it in a formula?

Any help would be appreciated.


For sake of explanation, I have two tables (SharePoint Lists).  


Reminders tables 

Reminder1Bob15Do your thingSmall
Reminder2Judy5Do the other thingMedium
Reminder3Jane11Do the last thingLarge
Reminder4Jane and Judy7Do SomethingMedium
Reminder5Bob6Do NothingSmall
Reminder6Steve2Just do itLarge



Case 11/1/111/5/151/7/19
Case 22/6/142/7/221/6/44
Case 36/11/017/11/196/2/21
Case 45/10/1510/20/306/5/66
Case 51/1/233/2/115/6/15


In my flow, I want to be able to get the appropriate item(s) from the Reminders table (done), look at the value of the Size column (done), then get all of the items from the Cases table (done) and find the days for which the column (specified from the Size Column) match the equation of Today+Days.


For example, if the Flow is triggered for reminder 4, I want to be able to evaluate the "Medium" column in the cases table, and find any that match Today+7 and send a reminder to Jane and Judy.   


Most of that, I'm totally good with, but I can't find a way to specifically use the appropriate column.   I thought i could pull in the list and then do a foreach.   Probably not the most efficient, but doable.   If I use a variable called VarColumnName to store Medium (and correct for the horrible end users who put spaces in the real column names) is there any way to pre-process the variable so that the flow would get "items('ApplyToEach')?['Medium']

items('ApplyToEach')?[replace(variables('VarColumnName'),' ','_x0020_')]
Community Support
Community Support

Hi @Vodomin,


Use expression as a parameter of variables() function is not workable.

As a workaround, you could create a Switch action to guide the Flow go to corresponding branches according to Size value of Reminders tables. For example:

Annotation 2020-06-10 112237.jpg


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

While I think that would work, it would nullify the intent of the workflow.   Part of my reason for making the workflow this way is to allow the users to modify the timings of their reminders and what reminders they choose without constant intervention to the flow.  If I use a switch like that, I'll have to update the flow any time they add or remove a reminder.  


I did receive some helpful input from a coworker who suggested I use an array, but I think it comes down to the same problem.  

As an example, I rewrote my Flow to illustrate the issue:


If I hard code the filter like this:

Using Text.png


Then I get the proper output:

using Text Output.png


But if I put the same text string into a variable, and use that as the query, I get nothing.   

with a variable.png


Again, much respect, appreciation, and admiration to anyone who can point me in the right direction.  

Hello @Vodomin 


When you get the column name into a variable, you can use the variable in the Filter Query field of the Get items action, where you get the cases.


So your Filter Query field could be: <variable ColumnName> eq <utcNow()+7 as 'yyyy-MM-dd'

Would that do the trick for you?

Kind regards, John

I don't think so. At least I haven't been able to make that work.   

Here is the output of where I set the variable:



In the next step I do as you suggest (I think).  In this case I'm using the starts with and "3799-" just for the example..


But it doesn't return anything even though the item exists in the inputs.




And I don't think there is a way to see what it's actually processing.   

Helpful resources

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (1,835)