Embedded Cards in Salesforce: Dynamic Filter
Hi all, does anyway know if there is a way to dynamically filter a Domo card embedded in salesforce on a unique value in the salesforce page (like customer or account ID). We wanted to embed cards on a customer overview page to show historical sales for that customer, but I do not want to have to create one for every customer (15k +). I doubt this is possible today, but I know I can use embedded links in Domo data tables to link directly to a salesforce page, I just wonder if anyone figured out a way to have that page id filter the Domo card embedded in Salesforce.
Thanks,
Josh
Best Answers
-
Hey Josh, I had the same issue. I was reading this post and almost thought I wrote it. Lol.
Fortunately there is something you can do to start with. It’s not ideal as the ideal state would be all the way down to the card level filter parameters with the embed feature, but it works for us and I think it will work for you as well. So here we go.....
Domo pages can be passed filters via a query string. So you can embed pages via a visualforce page and pass account or any other id’s to the page. It will then filter the entire page on the field or fields you want.
Here is the pfilters structure you can append to any domo page or card url to pass filtering:
pfilters=[{"dataSetId":<ID>, "column": "<Column Name>", "dataType": "<string |number | date>" , "operand":"IN", "values":<Array of values>}]
One other neat feature is if you have cards that are using different data sets, blends or etl’s and want to filter them all on a common field then just leave the data set blank. As long as all of your data sets share the same field name they will all filter on the value you passed even though the are not the same data set.
I have not been able to find a solution for single cards yet but my suggestion to Domo is to add this querystring capability to the embed card functionality and now we have max flexibility and don’t need to load the whole Domo interface in the SalesForce view.
Hope this helps.
CJ4 -
I got it to work!!!!
<apex:page standardController="Account">
<iframe src="https://my.domo.com/embed/card/11111186?enable=title&pfilters=[{"column":"AccountId","dataType":"STRING","operand":"IN",
%22values%22:[%22{!Account.Id}%22]}]
" width="600" height="550" marginheight="0" marginwidth="0" frameborder="0" scrolling="yes"></iframe></apex:page>2
Answers
-
Hey Josh, I had the same issue. I was reading this post and almost thought I wrote it. Lol.
Fortunately there is something you can do to start with. It’s not ideal as the ideal state would be all the way down to the card level filter parameters with the embed feature, but it works for us and I think it will work for you as well. So here we go.....
Domo pages can be passed filters via a query string. So you can embed pages via a visualforce page and pass account or any other id’s to the page. It will then filter the entire page on the field or fields you want.
Here is the pfilters structure you can append to any domo page or card url to pass filtering:
pfilters=[{"dataSetId":<ID>, "column": "<Column Name>", "dataType": "<string |number | date>" , "operand":"IN", "values":<Array of values>}]
One other neat feature is if you have cards that are using different data sets, blends or etl’s and want to filter them all on a common field then just leave the data set blank. As long as all of your data sets share the same field name they will all filter on the value you passed even though the are not the same data set.
I have not been able to find a solution for single cards yet but my suggestion to Domo is to add this querystring capability to the embed card functionality and now we have max flexibility and don’t need to load the whole Domo interface in the SalesForce view.
Hope this helps.
CJ4 -
I am trying to follow the steps by attaching the pfilters query string to the DOMO Card URL in apex iframe. But I am not successful in acheiving it. Can you let me know how you acheived to filter the DOMO card via Saleforce.It would be helpful if you also provide the steps or a syntax to acheive this.
0 -
@CJwrote:
Hey Josh, I had the same issue. I was reading this post and almost thought I wrote it. Lol.
Fortunately there is something you can do to start with. It’s not ideal as the ideal state would be all the way down to the card level filter parameters with the embed feature, but it works for us and I think it will work for you as well. So here we go.....
Domo pages can be passed filters via a query string. So you can embed pages via a visualforce page and pass account or any other id’s to the page. It will then filter the entire page on the field or fields you want.
Here is the pfilters structure you can append to any domo page or card url to pass filtering:
pfilters=[{"dataSetId":<ID>, "column": "<Column Name>", "dataType": "<string |number | date>" , "operand":"IN", "values":<Array of values>}]
One other neat feature is if you have cards that are using different data sets, blends or etl’s and want to filter them all on a common field then just leave the data set blank. As long as all of your data sets share the same field name they will all filter on the value you passed even though the are not the same data set.
I have not been able to find a solution for single cards yet but my suggestion to Domo is to add this querystring capability to the embed card functionality and now we have max flexibility and don’t need to load the whole Domo interface in the SalesForce view.
Hope this helps.
CJ
Hi @CJ, I was able to achieve the page filters as per your suggestion and also per the information available in Best Mode. But my requirement is When I login into Salesforce as an admin I need to view all the details in the embeded cards(My Cards is simple line Graph between Agents and No Of Consumers) and if I login as an Agent I need to view only that Agents data.Any suggestions on the above filtering method would be helpful.
0 -
Do you have a field in the data set that Id's the individual agent? If you do then just pass that from Salesforce as a filter value on that column when not logged in as an admin. When you are an admin then don't pass the filter value and you should get all the data to power those cards.
0 -
@CJwrote:
Do you have a field in the data set that Id's the individual agent? If you do then just pass that from Salesforce as a filter value on that column when not logged in as an admin. When you are an admin then don't pass the filter value and you should get all the data to power those cards.
@CJ : Yes I do have the field in the Dataset that holds the ID's of the individual agent. As I am new to this tool as in DOMO and SalesForce. Can you please let me know the ellaborated steps to pass the id as a filter value when admin and when as an agent. It would be helpful for me as well other users. Thanks in advance for your support.
0 -
This is great,we can use it to filter individual embedded cards within our visualforce page. Thank you so much for posting!!
0 -
Hi CJ,
By any chance did you have SSO enabled for DOMO? We have SSO enabled but since this is embedded in Salesforce it is not allowing for the authentication without first signing into DOMO.
Any help would be great.
Thanks Dwayne
0 -
Is there any way you can share with me the url you used in the salesforce Iframe? (remove any sensitive data and replace with generic terms)
I can't figure out how to pass the data in the URL....
this is all I'm able to get working:
<apex:page standardController="Account">
<iframe src="https://mycompany.domo.com/embed/card/720220402?" width="350" height="250" marginheight="0" marginwidth="0" frameborder="0" scrolling="no"></iframe></apex:page>0 -
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
2 -
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]}]0 -
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]}]1 -
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
0 -
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<apex:page 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></apex:page>0 -
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.
<iframe src="https://mycompany.domo.com/embed/card/8876?enable=title&pfilters=[{"column":"Account.Id","dataType":"STRING","operand":"IN","values":["Account.Id AS%22]}]
" width="600" height="550" marginheight="0" marginwidth="0" frameborder="0" scrolling="yes"></iframe></apex:page>0 -
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=[{"column":"Account.Id","dataType":"STRING","operand":"IN","values":["Account.Id AS%22]}]
" width="600" height="550" marginheight="0" marginwidth="0" frameborder="0" scrolling="yes"></iframe></apex:page>
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?0 -
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.
1 -
I got it to work!!!!
<apex:page standardController="Account">
<iframe src="https://my.domo.com/embed/card/11111186?enable=title&pfilters=[{"column":"AccountId","dataType":"STRING","operand":"IN",
%22values%22:[%22{!Account.Id}%22]}]
" width="600" height="550" marginheight="0" marginwidth="0" frameborder="0" scrolling="yes"></iframe></apex:page>2
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 755 Beast Mode
- 61 App Studio
- 41 Variables
- 693 Automate
- 178 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive