Limiting Loops to only count records with data in a property

EJackson23
Participant

Is there are way to only include the records in a loop that have data for a certain property? 

 

For example in the code below I'd like to only inlude the records if last_wk_usg is not none...

{% set associated_objects = crm_associations(contact_id, 'USER_DEFINED', 60, 'limit=20&orderBy=account_row_id', 'account_row_id,srvc_address,srvc_city,srvc_state,srvc_zip,acct_uom,acct_commodity,last_wk_start_dt,last_wk_end_dt,last_wk_usg,bill_cycle_days_remaing,day1_1_usg,day2_1_usg,day3_1_usg,day4_1_usg,day5_1_usg,day6_1_usg,day7_1_usg,day1_1_temp,day2_1_temp,day3_1_temp,day4_1_temp,day5_1_temp,day6_1_temp,day7_1_temp,wow_usg_diff_kwh,avg_temp_last_wk,wow_temp_diff_deg') %}

 

Thank you for your help.

0 Upvotes
2 Replies 2
dennisedson
Community Manager

@EJackson23 

You can use the filters in the CRM Search API to include only records that meet a specific criteria

Thanks,

Dennis




Check out our Community Developer Blog
where we feature our Community driven developer podcast and how to content
0 Upvotes
EJackson23
Participant

Thank you Dennis but this is a little out my range of capabilities. Was looking for something I could use directly in the hubL code.

0 Upvotes