Hi Cliff, that’s looking better. Can explain how you debugged the code? Are there any errors in your console?
An approach I usually take is to reduce the code to basic parts and ensure it works, then gradually build in the more complex parts. That way you can more clearly see what is working, and identify the aspect that breaks. For condition cards that generally means starting with a simple card with no condition and static data (value: 'random string'
). If that works you can then add the condition to make sure it appears only when expected. Once you have that you can add the code to extract the necessary data, and then work on presenting it properly. When a part is not working as intended you can inspect the values to make sure they are what you’d expect. For contact summary this could be done by outputting values to the console with console.log(value)
.
In your case, given that the card is not showing I would suspect that the appliesIf
function is behaving differently than you’d expect. It would be worthwhile to check the values passed to your function, since you might find that one of the values is unexpectedly undefined. If that’s the case, you might find this example helpful, especially since the function signature is different. You could follow the same pattern and use the globally available contact
, indirectly used as thisContact
in the example.