Reputation: 566
im getting json data from one api my respons is below and im putting it in notes variable. {"fitbit_reg_set":"fitbit_create_uname","fitbit_profile_set":"fitbit_create_uname"}
<#assign notes = notes?eval>
<#if notes.fitbit_profile_set>
it works if fitbit_profile_set is present in json . but if that is not present my script stop working .How i can check if that is exists can anyone tell me ?
Upvotes: 1
Views: 2268
Reputation: 91
You should add "??" so it will check if fitbit_profile_set exists and not null
<#if notes.fitbit_profile_set??>
Upvotes: 3