Flow - pulling correlated value from a list to assign as a variable

%3CLINGO-SUB%20id%3D%22lingo-sub-389528%22%20slang%3D%22en-US%22%3EFlow%20-%20pulling%20correlated%20value%20from%20a%20list%20to%20assign%20as%20a%20variable%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-389528%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20list%20with%20our%203%20offices%20listed%20and%20we%20have%20an%20HR%20Approver%20and%20a%20Finance%20approver%20for%20new%20hires.%20I%20would%20like%20to%20plug%20in%20the%20approvers%20into%20my%20approval%20workflow%20as%20a%20variable%20based%20on%20which%20location%20which%20is%20a%20value%20%22Location%22%20in%20the%20form.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20413px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F100271iFC26382D0284409E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22TableExample.PNG%22%20title%3D%22TableExample.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EMy%20equation%20looks%20like%20this%3A%3C%2FP%3E%3CP%3EHR-Approver%20where%20Locations%20eq%26nbsp%3B%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20111px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F100275iA90D4C704108234F%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22DynamicVariable%20copy.jpg%22%20title%3D%22DynamicVariable%20copy.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20know%20the%20%22Where%22%20clause%20is%20not%20valid.%20How%20would%20one%20achieve%20this%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20example%20is%20someone%20in%20the%20Dallas%20office%20submits%20a%20request%20for%20approval%20I%20want%20%22Jill%22%20to%20show%20up%20in%20the%20workflow%20as%20the%20approver.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20Nintex%20this%20is%20really%20easy.%20With%20Flow%20I%20am%20confused%20as%20to%20how%20to%20achieve%20a%20similar%20result.%20I%20created%20a%20variable%20called%20HR-Approver%20and%20am%20trying%20to%20assign%20the%20approver%20whose%20location%20matches%20the%20location%20passed%20in%20the%20form%20to%20that%20variable.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGuidance%20would%20be%20appreciated.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-389528%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Flow%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-481734%22%20slang%3D%22en-US%22%3ERe%3A%20Flow%20-%20pulling%20correlated%20value%20from%20a%20list%20to%20assign%20as%20a%20variable%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-481734%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F296319%22%20target%3D%22_blank%22%3E%40GregGuth%3C%2FA%3E%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20couldn't%20tell%20from%20your%20post%20where%20you're%20deriving%20the%20LOCATION%20variable%20in%20your%20screenshot%20for%20the%20formula.%20As%20I%20understand%20it%2C%20that%20LOCATION%20would%20have%20to%20be%20derived%20from%20the%20Requestor's%20location.%20I'm%20not%20sure%20how%20you're%20doing%20that%20now.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHaving%20said%20that%2C%20I%20created%20a%20similar%20SharePoint%20list%20to%20yours%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20style%3D%22width%3A%20779px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F110095iFBFAAE211319E4B4%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Approval-SP-List.PNG%22%20title%3D%22Approval-SP-List.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnd%20I%20created%20a%20basic%20Flow%20with%20a%20SharePoint%20'Get%20Items'%20action%2C%20with%20a%20Filter%20Query%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20style%3D%22width%3A%20664px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F110099i672BF7186901AB48%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Flow-Action.PNG%22%20title%3D%22Flow-Action.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhere%20%22Location%22%20matches%20exactly%20the%20internal%20name%20of%20the%20SharePoint%20column%2C%20and%20for%20the%20time-being%20I'm%20hard-coding%20the%20location%20I%20want.%20This%20properly%20queries%20the%20SharePoint%20list%2C%20and%20returns%20the%20one%20record%20that%20has%20location%20of%20%22Dallas.%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20591px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F110097i54FD71DFCD4FA717%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22output.PNG%22%20title%3D%22output.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHopefully%2C%20that%20gives%20you%20a%20sense%20for%20the%20OData%20filter%20syntax.%20Let%20me%20know%20how%20you're%20deriving%20the%20requestor's%20location.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOnce%20you%20do%20get%20the%20Location%20in%20a%20variable%20and%20use%20it%20in%20the%20filter%2C%20you%20might%20need%20to%20surround%20it%20with%20single%20quotes%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20449px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F110098i1FEC11210ABF1C8D%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22filter-with-quotes.PNG%22%20title%3D%22filter-with-quotes.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20this%20helps.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Deleted
Not applicable

I have a list with our 3 offices listed and we have an HR Approver and a Finance approver for new hires. I would like to plug in the approvers into my approval workflow as a variable based on which location which is a value "Location" in the form.

TableExample.PNG

My equation looks like this:

HR-Approver where Locations eq DynamicVariable copy.jpg

 

I know the "Where" clause is not valid. How would one achieve this?

 

The example is someone in the Dallas office submits a request for approval I want "Jill" to show up in the workflow as the approver.

 

In Nintex this is really easy. With Flow I am confused as to how to achieve a similar result. I created a variable called HR-Approver and am trying to assign the approver whose location matches the location passed in the form to that variable.

 

Guidance would be appreciated.

1 Reply

Hi @Deleted,

 

I couldn't tell from your post where you're deriving the LOCATION variable in your screenshot for the formula. As I understand it, that LOCATION would have to be derived from the Requestor's location. I'm not sure how you're doing that now. 

 

Having said that, I created a similar SharePoint list to yours:

Approval-SP-List.PNG

 

 

 

 

 

 

 

 

 

 

And I created a basic Flow with a SharePoint 'Get Items' action, with a Filter Query:

Flow-Action.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Where "Location" matches exactly the internal name of the SharePoint column, and for the time-being I'm hard-coding the location I want. This properly queries the SharePoint list, and returns the one record that has location of "Dallas."

 

output.PNG

 

Hopefully, that gives you a sense for the OData filter syntax. Let me know how you're deriving the requestor's location. 

 

Once you do get the Location in a variable and use it in the filter, you might need to surround it with single quotes:

 

filter-with-quotes.PNG

 

Hope this helps.