APIs & Integrations

ShubhSaxena
Participant | Elite Partner
Participant | Elite Partner

CRM card is not displaying the data of result array

Hello, @watchers

I am facing an issue in CRM card creation, I created a card for the deal object on the test portal and everything worked perfectly fine there, we are creating a link through that card and displaying that generated link in the card only using the results array ( refer to this doc for more info: https://developers.hubspot.com/docs/api/crm/extensions/custom-cards) but when I switched everything on the client's portal, the issue gets started, I am getting the card but when I am generating the link then the link is not displaying in the card but I can see everything working fine in the request body 

please refer to the below screenshot, if the request URL is having everything that I want to show in the card then why the card is not displaying this thing
screenshot-shop3stg.png

and see below, this is how I need to show, also the thing is some time my code runs and shows the desired things but sometimes it doesn't work at all 

screenshot-app.png


Please need the help urgently!!
0 Upvotes
4 Replies 4
Jaycee_Lewis
Community Manager
Community Manager

CRM card is not displaying the data of result array

@Teun and @himanshurauthan do you have any insight into the next steps for @ShubhSaxena ? 

 

Thank you! – Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes
Jaycee_Lewis
Community Manager
Community Manager

CRM card is not displaying the data of result array

Hey, @ShubhSaxena Thanks for reaching out. Can you provide any additional details, code snippets, or screenshots to help provide our community with more info, please? This can help our community better understand the issue and to provide additional insight into your question.

 

@LPM@Bryantworks have you run into similar issues with CRM cards? 

 

Thank you! – Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes
ShubhSaxena
Participant | Elite Partner
Participant | Elite Partner

CRM card is not displaying the data of result array

Hi @Jaycee_Lewis,

Do you have any updates for me, or can you please connect any of your engineers with me so that I can solve this issue ASAP 

0 Upvotes
ShubhSaxena
Participant | Elite Partner
Participant | Elite Partner

CRM card is not displaying the data of result array

Hi @Jaycee_Lewis,

Thanks for your help, below is the code snippet!

$deal_id = ( !empty( $_GET['associatedObjectId'] ) ) ? $_GET['associatedObjectId'] : '';

$userEmail = ( !empty( $_GET['userEmail'] ) ) ? $_GET['userEmail'] : '';


$form_page_url = get_permalink( get_option( 'custom_link_form_page' ) );

$custom_link_form_page_url = $form_page_url . '?deal_id=' . $deal_id .'&userEmail'. $userEmail;

global $wpdb;

$sql_data = $wpdb->get_results( "SELECT `id`, `product_array`, `created_date`, `modified_date`, `created_by`, `use`, `deal_id`, `checkout_link` FROM `wp_mwb_card_data` WHERE `random_string` = '". $deal_id ."' " );

foreach( $sql_data as $data ) {
$checkout_link = $data->checkout_link;
}

if( ! empty( $checkout_link ) ) {
$form_data = array(
"results" => [
array(
"objectId" => $deal_id,
"title" => $checkout_link,
"description" => "Created Link",
),
],
"primaryAction" => array(
"type" => "IFRAME",
"width" => 1100,
"height" => 850,
"uri" => $custom_link_form_page_url,
"label" => "Create Link"
),
);
} else {
$form_data = array(
"results" => [],
"primaryAction" => array(
"type" => "IFRAME",
"width" => 1100,
"height" => 850,
"uri" => $custom_link_form_page_url,
"label" => "Create Link"
),
);
}
$form_data_encoded = json_encode($form_data);

print_r($form_data_encoded);


In the above code, when I am generating the link and saving i in the database then after checking the HubSpot's response and taking the deal id from there, processing that deal id further and checking whether any link is generated for this deal or not in past, if yes then just show the created link there, if no then show the crate link button again   

please help me in this case 

 

0 Upvotes