Filter Addon / Conditional Addon

Options

Hi there

How do I filter which records are added-on in an addon? Details in somewhat wordy Loom, hope it makes sense.

Thanks.

https://www.loom.com/share/e2f40fbc7b594e66b857d074d0774120

Tagged:

Best Answer

  • Tim McIntosh
    Tim McIntosh Member
    Answer ✓
    Options

    Hi @dorian

    I had a quick look at your video. My recommendation would be to use an INNER JOIN on one of your queries within the functional stack.

    You would be joining on subsidy.business_id = workers.business_id. If you need to show addon data against your main API call. Make sure you have the business_id from your input in your addon and you can send your business_id from your main API call to your addon.

    Hope this helps.

Answers

  • dorian
    dorian Member
    Options

    Thanks @Tim McIntosh I actually just figured out that I should add that business_id as an input to the addon. That solved the problem. I didn't need to add any joins just by nature of me first calling the subsidies table, then the user table. Thanks for the reply!