Embedded Cards in Salesforce: Dynamic Filter

Reply
Highlighted
Visitor

Re: Embedded Cards in Salesforce: Dynamic Filter

To embed a card with filters passed via url (remove the angle brackets and replace with your own variables):

 

<iframe src="https://mycompany.domo.com/embed/card/720220402?enable=title,summary&pfilters=[{%22column%22:%22<COLUMN TO FILTER>%22,%22dataType%22:%22<STRING, NUMBER, DATE, ETC>%22,%22operand%22:%22<IN, NOT IN, =, ETC>%22,%22values%22:[%22<VALUE TO FILTER AS>%22]}]" width="350" height="250" marginheight="0" marginwidth="0" frameborder="0" scrolling="no"></iframe>

 

The important part is bolded and underlined.

 

This will also work for pages, just replace the URL in src=with the entire page URL

Green Belt

Re: Embedded Cards in Salesforce: Dynamic Filter

Thank you for this, I'm a neophyte when it comes to HTML.  

I'm trying to pass the Account.ID field from a salesforce page into the value to filter.  How would that look in the code you attached?    I half a33ed this and got a pfilter error on my visual force page.  I don't know what string to put in the code.  When my guys are in Salesforce and they are on Acme's Account page in I want to pass that Account.ID from Salesforce into this string. Somehow....

 

https://mycompany.domo.com/embed/card/12345679?enable=title,summary,&pfilters=
[{%22column%22:%22<Account.Id>>%22,%22dataType%22:%22<STRING>%22,%22operand%22:%22<IN=>%22,%22values%22:[%22<VALUE TO FILTER AS>%22]}]
Visitor

Re: Embedded Cards in Salesforce: Dynamic Filter

1) You have an extra comma before "&pfilters" 

2) Angle brackets must be removed

3) Replace <VALUE TO FILTER AS> with the account ID string you want to look for

 

https://mycompany.domo.com/embed/card/12345679?enable=title,summary&pfilters=
[{%22column%22:%22Account.Id%22,%22dataType%22:%22STRING%22,%22operand%22:%22IN%22,%22values%22:[%22VALUE TO FILTER AS%22]}]

 

Green Belt

Re: Embedded Cards in Salesforce: Dynamic Filter

thank you, but that is what I don't understand.  The account ID is going to change depending on what account they are viewing in Salesforce

Green Belt

Re: Embedded Cards in Salesforce: Dynamic Filter

I know I'm dense, but my HTML skills are almost as good as my latin (nill)

I'm getting a pfilter error with this

<apexSmiley Tongueage standardController="Account">

<iframe src="https://mycompany.domo.com/embed/card/12636?enable=title,summary&pfilters=
[{%22column%22:%22Account.Id%22,%22dataType%22:%22STRING%22,%22operand%22:%22IN%22,%22values%22:[%Account.Id AS%22]}]
" width="350" height="250" marginheight="0" marginwidth="0" frameborder="0" scrolling="no"></iframe></apexSmiley Tongueage>

 

Green Belt

Re: Embedded Cards in Salesforce: Dynamic Filter

Ok, I've got to be close b/c now my only "error" is the card in Domo when posted in Salesforce says: No Data Filtered in Range.  image.png

<iframe src="https://mycompany.domo.com/embed/card/8876?enable=title&pfilters=[{%22column%22:%22Account.Id%22,%22dataType%22:%22STRING%22,%22operand%22:%22IN%22,%22values%22:[%22Account.Id AS%22]}]
" width="600" height="550" marginheight="0" marginwidth="0" frameborder="0" scrolling="yes"></iframe></apexSmiley Tongueage>
Green Belt

Re: Embedded Cards in Salesforce: Dynamic Filter

I'm so darn close:

ok, so I'm very close (I think).  I have this, but I'm getting a message that says "No Data in Filtered Range"  Which tells me I'm not passing the Account.ID over.  

 

<iframe src="https://mycompany.domo.com/embed/card/876?enable=title&pfilters=[{%22column%22:%22Account.Id%22,%22dataType%22:%22STRING%22,%22operand%22:%22IN%22,%22values%22:[%22Account.Id AS%22]}]
" width="600" height="550" marginheight="0" marginwidth="0" frameborder="0" scrolling="yes"></iframe></apexSmiley Tongueage>


So what I thought I want to do, but don't know how is to somehow get the Account id in the URL to pass thru?

 

https://my.lightning.force.com/lightning/r/Account/0013000xpattAAM/view


Shouldn't I be able to pass the account id from the page I'm on into my code above?

Visitor

Re: Embedded Cards in Salesforce: Dynamic Filter

Unfortunately in your case it looks like you'll have to write a javascript function to find and pass the account ID from the current page URL into the Domo iframe URL.

Green Belt

Re: Embedded Cards in Salesforce: Dynamic Filter

I got it to work!!!!

<apexSmiley Tongueage standardController="Account">

<iframe src="https://my.domo.com/embed/card/11111186?enable=title&pfilters=[{%22column%22:%22AccountId%22,%22dataType%22:%22STRING%22,%22operand%22:%22IN%22,
%22values%22:[%22{!Account.Id}%22]}]
" width="600" height="550" marginheight="0" marginwidth="0" frameborder="0" scrolling="yes"></iframe></apexSmiley Tongueage>

 

Announcements
Dojo Day is Coming! Mark your calendars for May 30th 0900-1700 MST Click here for more information