Forum Discussion
A few days ago, I also posted an idea for the same peterlu. Hope Lithium would implement it
https://community.lithium.com/t5/Product-Ideas/Exclude-posts-with-certain-board-ids/idi-p/305516
- cikeChampion
Hi guys,
there is already an idea for is: https://community.lithium.com/t5/Product-Ideas/quot-NOT-IN-quot-operator-for-APIv2/idi-p/218558.
Cheers,
Christian
- him_varmaAdvisor
You can achieve this by custom freemarker function. Firstly you can store all the boards IDs that you do not want to show in a freemarker array. Please see below code:
<#assign boards_id = ['board_id_1','board_id_2','board_id_3'] />
After that you can make a rest api v1 or v2 call to fetch all messages and run through loop and also check if the board id exists or not. In my case I am using V2 call. See below code:
<#assign messages = rest("2.0", "/search?q=" + "select * from messages"?url).data.items /> <#list messages as message> <#if !boards_id?seq_contains(message.board.id)> <!-- checks if board id is not in mentioned IDs array --> <!-- display message's content other than boards you do not want to show --> </#if> </#list>
Please give KUDOS if you find this helpful. Mark as Accepted Solution in case of solution you were looking for.
peterlu -
This query would work in pagination environment.
select * from messages where board.id in ('board1,board2')
Give kudos if you find my posts helpful or mark solution if it answers your queryTariq
- peterluChampionTariqHussain yes, your query works. But if a customer has 100+ boards, and they just want to ignore (NOT IN) 1 board only. It is not a good idea to do board.id in ('board1', 'board2'..........'board300')
Related Content
- 6 years ago