Dynamic value inside a list query

  • 7 October 2022
  • 2 replies

Badge +2

Hello, i have a question about a process i would like to create inside Workflow Cloud.
I have a workflow based on a form, and the data in the form are used to create items in a Sharepoint list. 
For the sake of clarity, i'm gonna give an example:
my form ask about 3 things, a first name, a last name, and a city, which you select from a dropdown (let's say Paris, London, Madrid and Berlin).
My sharepoint Site also has 4 more lists, already filled, and each one of these list is named after a city, which correspond to the city asked about in my form.
In these lists are email adresses.
Is it possible, in my workflow, to search for the city name given in the form, and query the correct list from that data?
I talk about dynamic value because the perfect solution would allow me to dynamically add city possibilites in my form aswell as in my Site, with a corresponding new list.
I already thought about making a branch by Value action, but i would like to know if there was a more efficient way to create this part of my workflow.
I hope my question is clear. Thanks!


Best answer by jesse_mchargue 7 October 2022, 14:32

View original

2 replies

Hey @gsol 


Yes you should be able to accomplish this by simply using the form variable in the "Query a list" action in the workflow. This would make the list selection based on what was selected in the form. Something like this:


Word of caution here, you may need to configure the "Query a list" action with an actual list BEFORE selecting the variable if you are planning on adding any sort of conditions on the query. This is because the condition builder will query what columns are in the list selected. This means you will have to build out the condition, and then change the list name to the variable you wish to use. Also, this considers that all of your lists that are going to be queried have the necessary columns in them.


Hope this helps

Badge +2
thank you for your answer, your way was pretty simple but it didn't cross my mind.