1

I am using SearchKit to build a professional membership register in Civi 5.58.1. I want to show the value in a transformed field from the search (showing professional registration details), only if the field "Registration Status" does not have the value "Retired". I have tried using the following Smarty code in Rewrite, which does not seem to work. Am I doing something wrong?

{capture assign=RegStatus}{[Membership_Contact_contact_id_01.Details_ccc.Registration_status:label]}{/capture}
{capture assign=RegDetails}{[CONCAT_WS_Membership_Contact_contact_id_01_Details_ccc_Practise_Licensing_Authority_Membership_Contact_contact_id_01_Details_ccc_Practise_license_number]}{/capture}
{If $RegStatus eq 'Retired'}
{$null}
{else}{$RegDetails}
{/if}
3
  • 3
    Hi.Not sure how the actual table display is structed but this for example works to show some custom contact information for a member with 'new' status on dmaster - {if '[Contact_Membership_contact_id_01.status_id:label]' eq 'New'}[constituent_information.Most_Important_Issue:label]{else}{/if} Commented Apr 27, 2023 at 12:42
  • Thank you Rebecca - I can see it was a syntax problem - you solved it! Much appreciated Commented Apr 27, 2023 at 14:48
  • @RebeccaTregenna do you want to add as an answer. this helped me.
    – petednz - fuzion
    Commented Aug 20 at 23:17

1 Answer 1

2

Not sure how the actual table display is structed but this for example works to show some custom contact information for a member with 'new' status on dmaster

{if '[Contact_Membership_contact_id_01.status_id:label]' eq 'New'}[constituent_information.Most_Important_Issue:label]{else}{/if}

2
  • great. just adding another example ... {if '[Membership_Contact_contact_id_01.Walk_info.Country_of_origin:label]' eq 'Other'} [Membership_Contact_contact_id_01.Walk_info.Country_of_origin_Other]{else}[Membership_Contact_contact_id_01.Walk_info.Country_of_origin:label]{/if}
    – petednz - fuzion
    Commented Aug 21 at 19:02
  • 1
    Just a note it might be better to use :name not :label, otherwise it won't work if someone switches languages, or edits the label.
    – Demerit
    Commented Aug 23 at 23:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.