Forum Discussion
Trying to use results from first query in second query on SOAP API
- 3 years ago
Many months later, I have a solution. My first inclination to cram all the org numbers into a single parameter and run that through the second query was the wrong approach. What does work is running a query that creates a list of org numbers in a single column, one per row. Add a parameter for org number and use that in the second query that produces directory information. Convert the second query into a function, then finally Add Column > Invoke custom function in the list of org numbers. Also, privacy levels need to be set to "Always ignore Privacy level settings" in order for this to work. I think this is because Power Query is using the results of one query in another query.
I would've used a function the first time around had I known it were possible. I'm learning stuff every day here.
Many months later, I have a solution. My first inclination to cram all the org numbers into a single parameter and run that through the second query was the wrong approach. What does work is running a query that creates a list of org numbers in a single column, one per row. Add a parameter for org number and use that in the second query that produces directory information. Convert the second query into a function, then finally Add Column > Invoke custom function in the list of org numbers. Also, privacy levels need to be set to "Always ignore Privacy level settings" in order for this to work. I think this is because Power Query is using the results of one query in another query.
I would've used a function the first time around had I known it were possible. I'm learning stuff every day here.
- BirkirGre3 years agoNew Member
Any chance you can share your approach (code)?