Alteryx Server Discussions

Find answers, ask questions, and share expertise about Alteryx Server.
SOLVED

Help using API get workflows search parameter

hroderick-thr
11 - Bolide

Using server version 2021.4

I can get the API to give me all workflows.

I can't seem to get search parameter entered right or find documentation or examples

I need to get a specific workflow name in a specific collection name.

Thank you

 

Capture.jpg

 

 

9 REPLIES 9
TimN
13 - Pulsar

Just enter the text string, no quotes.  I believe it will search all the fields of the workflow metadata.  I don't think that would include the Collection name though.  You could use the Collection api - it contains the app ids - then get all all workflows and join on app id.

hroderick-thr
11 - Bolide

Both of these, with quotes removed, got nothing returned. 

collections.collectionName=Prod Stage

collectionName=Prod Stage

It was same as with the quotes in place

I also tried with single quotes ' instead of double ", but no return

:( Thanks for trying

TimN
13 - Pulsar

I think you are looking for a Collection name in Workflow metadata.  Collection Name is not in Workflow API returned data - I think.  I'll try and demo what I think you need.

TimN
13 - Pulsar

Using the Collections api /admin/v1/collections/, look for Prod Stage in the returned data. Get all the app ids within the data returned for that Collection. Then search in the /admin/v1/workflows using each app id.  This is how to do it using Alteryx Gallery Api documentation but you could query MongoDB directly to automate it.

hroderick-thr
11 - Bolide

Thanks TimN, But I need to find the workflow id by searching on the collection name "Prod Stage" and the workflow name "test workflow". How to specify that filter in the search variable is where I'm stuck.

hroderick-thr
11 - Bolide

I figured out how it seems to be working, but that is inadequate for my needs so I'll resort to the Mongo db

 

It seems to be searching for a string in the returned Jason. 

For example, I could enter THR into the search and it would find workflows that have THR in any field.

I did not test case THR vs Thr

 

I'm giving TimN resolver credit because he helped a lot and mentioned the MongoDB. Thanks Tim

 

Values with embedded blanks did not fare well.

For example putting MY THR would return nothing even though some values in the json contained MY THR

 

If anyone knows of a way to search more precisely than this, please let me know.

SPetrie
12 - Quasar

This is the method I use for targeting specific workflows in a collection.

Server.PNG

 

I pull a list of all workflows on the gallery, names and IDs.

Then I pull a list of all workflows contained in the collection I care about. I join it back to the workflow list to get the app name associated with the flows in my container.

Once I have that, I use the name field to match the workflow I am looking for and then pass it along to be run.

A lot of my flows have spaces in them and have had no issues matching names so this may work for you as well.

I can mockup a generic version for you if you want to try it.

hroderick-thr
11 - Bolide

Thank you @SPetrie . I expect that to work.

SPetrie
12 - Quasar

Here is that portion of the workflow incase you need it.

It uses the API v3 macro pack