dosubot[bot] commented on issue #35884:
URL: https://github.com/apache/superset/issues/35884#issuecomment-3461300469

   <!-- Answer -->
   The issue is with the format of your extra_filters: for the 'IN' operator, 
the val field must be an array, not a string. In your URL, you have 
`"val":"11"`, but it should be `"val":["11"]`. 
   
   Here's how your form_data should look (before URL encoding):
   
   ```json
   {
     "slice_id": 154,
     "extra_filters": [
       {
         "col": "province_id",
         "op": "IN",
         "val": ["11"]
       }
     ]
   }
   ```
   
   URL-encoded, this becomes:
   
   ```
   
form_data=%7B%22slice_id%22%3A154%2C%22extra_filters%22%3A%5B%7B%22col%22%3A%22province_id%22%2C%22op%22%3A%22IN%22%2C%22val%22%3A%5B%2211%22%5D%7D%5D%7D
   ```
   
   So your working URL should be:
   
   ```
   
https://my_superset.com/explore/?slice_id=154&standalone=1&form_data=%7B%22slice_id%22%3A154%2C%22extra_filters%22%3A%5B%7B%22col%22%3A%22province_id%22%2C%22op%22%3A%22IN%22%2C%22val%22%3A%5B%2211%22%5D%7D%5D%7D
   ```
   
   This format is required for Superset v5.0.0 and later—if you use a string 
for val with the IN operator, the filter will not be applied. See [this 
discussion and 
example](https://github.com/apache/superset/discussions/32754#discussioncomment-12703152)
 for more details.
   
   If you still have issues, try using adhoc_filters instead, or check if your 
chart type supports extra_filters. Also, check your Superset logs for any 
errors if the filter still doesn't apply.
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/85ae752f-13e9-41c7-8e38-d83ff7d282c4?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/85ae752f-13e9-41c7-8e38-d83ff7d282c4?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/85ae752f-13e9-41c7-8e38-d83ff7d282c4?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/85ae752f-13e9-41c7-8e38-d83ff7d282c4?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/85ae752f-13e9-41c7-8e38-d83ff7d282c4?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/85ae752f-13e9-41c7-8e38-d83ff7d282c4?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/85ae752f-13e9-41c7-8e38-d83ff7d282c4?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat
 with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=githu
 b)&nbsp;[![Join 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/35884)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to