3

I have a filter that I created some time ago, and I want to change it... The only way I can find to do that is to set again all the fields I need. It would be useful if we can enter the current filter value and then change it and get a new one!

This is how it looks in OS X/Chrome:

Filter edit

2
  • just found there is a edit box, that allows to enter the current value filter... is kind of difficult to see it... but is there...
    – UXDart
    May 24, 2017 at 17:04
  • added an image to show how it looks.. is difficult to know you can edit it atm
    – UXDart
    May 24, 2017 at 17:20

1 Answer 1

2

I copy my answer from StackApps here verbatim, with a small addition at the end about how to use /create-filter.

You can create and edit filters from the documentation page of the API endpoint.

So you start at the Index of all endpoints. There you'll find /users/{id}/answers.

On the right at the top of the parameter block you'll find the filter dialog:

enter image description here

When you click the [edit] link the filter dialog opens:

enter image description here

Where you can expand any the [types] provided by this endpoint.

enter image description here

If you click [Save] you'l get a magic number representing your selection.

You can also provide an that magic when you start editing. You take the filter value from the url, in your case:

!3u0zcO%28lpHVEGuskA

but notice it has %28 in it which indicate it is url encoded. So we first reverse that by running this in the Developer Console

decodeURI('!3u0zcO%28lpHVEGuskA');

which returns

!3u0zcO(lpHVEGuskA

You can copy-paste that value in the textbox at the top of the filter dialog, to get the types and fields that were selected for that magic number:

enter image description here

Another option is to use the read-filter endpoint which returns an object showing the selected fields for a particular filter.

You can use the /create-filter endpoint to create a filter programmatically by providing the fields you want to include or exclude which would return you the actual filter. If you have stored the fields you used earlier, for example in a JsFiddle, you can quickly adapt that and obtain the new filter value.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .