Hide Custom CRM Card

Hello,

I am working on CRM Card

I have created one card for ticket object, and it’s working.

My issue is, on some tickets I don’t want to display this card, I will decide that based on specific ticket property.

if(isset($request->userId) && isset($request->source_type)){
	$result = array(
		'results' => [],
		'primaryAction' => array(
			'type' => 'IFRAME',
			'width' => 890,
			'height' => 748,
			'uri' => 'https://example.com/create-iframe-contents',
			'label' => 'Send Message'
		)
	);
}else{
	$result = array(
		'results' => [],
		'primaryAction' => []
	);
}

Here you can see in my code, If ticket has a property source_type than only I want to display my CRM card, or else I am sending blank response.

The problem is blank response is giving error on Ticket CRM card,

So, my question is, What response I should send, when I don’t want to display my CRM card.

Hi, @kumarb1 :waving_hand: Thank you very much for including your details. It’s much appreciated. Hey, @Mike_Eastwood @jpsanchez @PAtlan have you tackled anything similar in your project work? Thanks for taking a look!

Best,

Jaycee

Hi @kumarb1 , sorry for picking this up late. We’ve had similar issues, and as far as we see, there is no way NOT to show the card. In our case we are lucky because we have something to show all the time, so it’s not an issue. But I’d second an idea to develop “conditional” cards.

Hi @kumarb1

We couldn’t figure out how to hide the CRM Card so we returned some text (json) explaining that the card was empty. This stops errors and explains to users why the card isn’t showing information.

Have fun

Mike

Hello Mike,

I understand that, But Isn’t there any way to hide CRM card?, There should be a specific response format when we don’t want to display the card.

Hi, @kumarb1 Based on the lack of specific documentation + the comments from our community, I’d suggest creating an Ideas post. My guess is we can get @PAtlan and @Mike_Eastwood to add an upvote as well.

Best,

Jaycee