Alteryx Server Discussions

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

List Box Selection Issue via API

Amit_G_Limbasia
8 - Asteroid

Dear Alteryx Community,

 

I hope this message finds you well. I am reaching out today to seek your help in resolving an issue I am facing with an Alteryx Analytic App. The app works flawlessly within the Alteryx Desktop Designer and on the Gallery. However, when I attempt to call it via the server's API, the List Box selections are not applied as expected.

 

Issue Description:

The problem occurs when I run my Alteryx Analytic App via the server's API. While running the same workflow in the Gallery, List Box selections work as intended, filtering the output based on the selected values. However, when I call the workflow using the API, the List Box selections seem to be ignored, and the API returns all columns instead of the columns corresponding to the selections in the List Box.

 

Workflow and Python Code:

I have attached the workflow and Python code I am using for the API call, as I believe this might help you better understand the issue. You can find the files here:

Attach Workflow

image.png
Attach Python Code

 

I've reviewed the Alteryx documentation and searched for similar issues, but I haven't been able to find a solution yet. Your expertise in Alteryx would be greatly appreciated in helping me resolve this issue.

What I've Tried:

  • Checked for any potential discrepancies between the List Box settings in the Gallery and the API call.
  • Reviewed the API documentation and made sure I'm following the correct procedures.
  • Verified the compatibility of my workflow and code with the Alteryx Server version.

How You Can Help:

If you have encountered a similar issue or if you have any insights into how to resolve this List Box selection problem when calling a workflow via the Alteryx Server API, your guidance would be immensely valuable. Please share your thoughts, suggestions, or any relevant experiences that could help me get this issue sorted out.

I'm looking forward to your expertise, and I thank you in advance for your time and assistance. If you require any additional information or details, please feel free to ask.

3 REPLIES 3
patrick_digan
17 - Castor
17 - Castor

Hi @Amit_G_Limbasia! When you're creating your payload in the api, I would have the list box to look just like the rest of your interface tools. So you currently have:

"name": "List Box (10)",
    "type": "QuestionListBox",
    "description": "Columns",
    "value": "Row ID,Order ID",
    "multiple" : True,
    "priority":"string"

 

Instead, I would simplify and just send the name/value pair like:

"name": "List Box (10)",
     "value": "Row ID,Order ID"
   

Importantly, you will need to make sure that the value you're sending is correct (it's possible Row ID,Order ID isn't the correct syntax). 

 

Using an example, here's how the listbox is setup for one of my workflows:

image.png

When you're sending the payload in the api, you need to replicate the start/separator/end text. In this case, I need to separate my items by "," to match what my listbox is expecting. To make matters more complicated, in JSON we have to be careful and escape the quotes by using a slash (\). So for my workflow, I would have this python code (using your name/values as an example and my listbox setup. You'd need to use your listbox setup):

"name": "List Box (10)",
     "value": "Row ID\",\"Order ID"
   

 You can also double check this by using the debug view in Designer and the log can confirm that you've got the right syntax. Their is a debug log that will have your listbox syntax:

<Value name="List Box (10)">Row ID","Order ID</Value>

 Hope that helps!

Amit_G_Limbasia
8 - Asteroid

Dear patrick_digan,

Thanks for the revert, I Have try using Generate custom list. But Since I am using Select tool with List box. I have received this error

Capture.JPG

 

But I have Find the one solution by twiting Payload we can able to get correct result :

 

 {
        "name": "List Box (10)",
        "description": "Columns",
        "value": "Order ID=True,Order Date=True,Ship Date=False,Ship Mode=False,Customer ID=False,Customer Name=False,Segment=True,Country=False,City=False,State=False,Postal Code=False,Region=False,Product ID=False,Category=False,Sub-Category=True,Product Name=False,Sales=False,Quantity=False,Discount=False,Profit=False,Discount Given=False",
        "multiple": True,
    }

 

 

In this type no config needed.

Alternative way:

{
    "name": "List Box (10)",
    "description": "Columns",
    "value": "Order ID=true,Order Date=true,Ship Date=true",
    "multiple": True,
}

 

In this method You need to unselect all column in select tool before saving workflow

 

Thanks for solution!

patrick_digan
17 - Castor
17 - Castor

@Amit_G_Limbasia Glad you got it working!