Skip to main content

#Python0 discussing

Hello, I'm trying to look for a way to query Tableau  API (most likely REST) to create a table containing, for each datasource, all the tables used and the way they are linked to each other (join, relationship). 

I also would like the username/account used to set up the connection to the database.  

 

It's not in GraphQL directly, sadly. And the closest thing I found related to this use case is 4y old and recommends to download each dashboard in .hyper and parse it to find the info.  (

How to get relationship info | Salesforce Trailblazer Community

)  

 

My manager is convinced he saw a Product news or an article mentioning that an endpoint was available somewhere somehow to do this, though.  

 

Does anyone ever had this kind of use case ? How did you solve this ? Does the endpoint thing ring any bell ? 

 

I tried using Tableau Client Server but datasources do not have a .tables (

API reference

) and I don't see any way to call a table within a datasource with it.  

 

 

 

#Tableau APIs & Embedding

2 answers
  1. Jan 10, 12:01 AM

    Hi @Orion Mussard

    I didn't test this specific endpoint yet but I think you are referring to the new VizData Service API (VDS) available since Tableau Server v.2025.1. 

    There is a get data source model endpoint: 

    https://help.tableau.com/current/api/vizql-data-service/en-us/reference/index.html#tag/HeadlessBI/operation/GetDatasourceModel

    In regards to your second question, you can get the connection username using this REST API endpint: 

    https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_data_sources.htm#query_data_source_connections

0/9000

Good morning.  In a prior job, I had a colleague who could take a twbx file and I believe he would use python to provide a breakdown of the calculated columns (the formula & where they are used), so we could build documentation. 

 

I've lost touch with this person and it would be helpful in my current role.  Is anyone in the community familiar with this and could provide information?  Thanks. 

 

#Tableau Desktop & Web Authoring  #Python

3 answers
  1. Jan 8, 4:38 PM

    @John Cusick

     

    Hi, in this case you may use some online apps. 

     

    Paula Muñoz Workbook Analyzer: 

    https://paulisdataviz.shinyapps.io/tableau_workbook_analyzer/#section-workbook-summary

     

    Tableau Tools 

    https://tableautools.imgwho.com/

     

    Marcelo Has Data Dictionary 

    https://tools.tableauzando.com.br/data-dictionary

    https://www.linkedin.com/feed/update/urn:li:activity:7188900461096169472/

      

     

    I have also read about people who uploads the twb (not the twbx) to chatgpt, and start making questions: 

    https://www.linkedin.com/posts/cooper-wenhua-04534816a_tableau-gemini-ai-activity-7384152060746715136-31-y?utm_source=share&utm_medium=member_desktop&rcm=ACoAAAadvasB7DwPSjZdBNUNxs-9d9Dwlp2JfKc

     

    Also, if familiar with python, you would find Ana de Rey Castro code useful: 

    https://github.com/scinana/tableauCalculationExport

     

    https://www.youtube.com/watch?v=fgJjpCZ5Rxc

     

    If this post resolves the question, would you be so kind to "Accept this Answer"?. This will help other users find the same answer/resolution and help community keep track of answered questions. Thank you. 

     

    Regards, 

     

    Diego Martinez 

    Tableau Visionary and Tableau Ambassador 

0/9000

The recording of the Virtual Healthcare Tableau User Group is now available here.

 

Huge thanks to null, null, & Craig Budzynski for an awesome meeting!

 

If you are interested in presenting at a future meeting, please reach out to Jonathan Drummey.

4 answers
  1. Mar 9, 2017, 5:08 AM

    I second the thanks to Craig and Mark for presenting!

     

    Attached are my slides and the files for the Tableau tip I'd planned to deliver, I will record it at some point in the next couple of weeks and link back to it here.

     

    Also, here's info about speaking at TC17:

    Apply to share your Tableau story at TC17 | Tableau Software

    Hubb Call for Papers

     

    null's blog http://ugamarkj.blogspot.com/ has posts on some of what he talked about today, here are two specific posts:

     

    Tableau Zen: Automated data lineage documentation using #Python

    Tableau Zen: Live XML Data in Tableau via Exasol

     

    Jonathan

0/9000

Our last #analytics Tableau user group is available on Youtube

 

👉👉👉 https://youtu.be/-6FwFeXjPTA

 

Timea Töltszéki spoke about "Harnessing Tableau tools for creativity and productivity".

Timea's presentation : https://docs.google.com/presentation/d/15Z33qAlLsmjq9rgBkD9_dxV17L-H4J21CO_ThsKHvb4

 

Agata Mezynska showed us how "Business #Dashboards and ⌗storytelling can work together".

Let's check! Agata's presentation : https://public.tableau.com/app/profile/agata.mezynska/viz/StorytellingandDashboards/Opowieoopowieci

 

Last but not least Daniel Bolinson presented "Game on: Your dashboards can do more with ⌗Extensions and #Python"

Ressources:

https://trexjacket.readthedocs.io/

https://anvil.works/x

https://www.bakertilly.com/technologies/anvil-x

https://www.youtube.com/playlistlist=PLDZ8gNI9Omg7qgDAiNztpgX9cEmi_7NOI

 

youtu.be

0/9000

Do not miss our next #Analytics Tableau User group happening, on March 28th at 6pm CET - 9am PST - 10pm IST !

 

https://usergroups.tableau.com/events/details/tableau-analytics-tableau-user-group-presents-harnessing-tableau-tools-for-creativity-business-dashboards-and-storytelling-can-work-together/

 

Our amazing Agenda :

 

Timea Töltszéki will speak about "Harnessing Tableau tools for #creativity and productivity". Several tools and AI features can significantly improve your productivity in #datavisualization and analysis. Providing a wreath of applications in action that can improve your creativity and efficiency in Tableau.

 

Agata Mezynska will show us how "⌗Business #Dashboards and ⌗storytelling can work together". The business dashboards provide us with ⌗visualizations of fresh new data every day. Do they tell stories? Is storytelling needed in business at all? And is it possible for a regularly refreshed story to be still engaging? Let's check!

 

Daniel Bolinson will present "Game on: Your dashboards can do more with ⌗Extensions and #Python" The Tableau Extensions framework lets you do more with your Dashboards. By writing back to data sources, seamlessly integrating models, and allowing your users to enrich the insights your dashboards offer, dashboards become powerful data tools.

 

We hear that some of you were having difficulty joining Bevy live, so in addition of recording the session, we will stream it live in Linkedin!

 

If you wish to see the recording of our past events, please access our Youtube Page : https://www.youtube.com/@analyticstug

 

Annabele

 

usergroups.tableau.com

0/9000

Hi, I'm New to SFCC OCAPI. My purpose is to Export all Orders from "development.demandware.net" after certain date and this can happen Quite frequently like once in every 2 days. I'm currently using Python to achieve this using the endpoint "s/{{SITEID}}/dw/shop/v18_1/order_search". The problem is One call is getting me only 25 Records. Again i have change the query from dynamically to start from RecordNo 26 for the next call. So, If I have like 10,000 records, it makes upto 400 calls everytime the scirpt runs.  The alternative options i'm aware of is:

- OCAPI Batch requests

- OCAPI Export job (Tried this, but haven't got enough knowledge to set this up) 

 

So, I'd like to know if my purposed is achievable using the batch request. I tried to do this using the  documentation. And, the response was 200 with no response body using the below code.

 

url = f"https://{DOMAIN}/s/-/dw/batch"

url_param = {'client_id': CLIENT_ID}

header = {'Authorization': 'Bearer ' + token,

'Origin': f'https://{DOMAIN}',

'Content-Type': 'multipart/mixed;boundary=23dh3f9f4',

'x-dw-http-method': 'POST',

'x-dw-resource-path': 's/{{SITEID}}/dw/shop/v18_1/order_search'}

body = """

{

"query" :

{

"filtered_query": {

"query": { "match_all_query": {} },

"filter": {

"range_filter": {

"field": "creation_date",

"from": "%s",

"from_inclusive": true

}

}

}

},

"select" : "(**)",

"sorts": [{

"field": "order_no",

"sort_order": "asc"

}],

"start": %s

}""" %(RETRIVE_RECORDS_FROM, startRecordFrom)

response = requests.post(url, params = url_param, headers = header, data = body)

 

My code doesn't have a x-dw-content-id as the above is an initial request. If its possible to achieve my purpose, how should my sub-request looks like.? And after that how do i retrieve the data of my request.?

 

I maybe asking for too much information. But, i couldn't find much information about this online so had to ask every question i have in one post. 

 

Thanks in advance.

 

#OCAPI #Python #Process Batch  @* B2C Commerce * @B2C Commerce Developers

1 answer
  1. Sep 12, 2023, 1:07 PM

    Hi @Harsha Vardhan Seelam,

    First of all in one request If I remember correctly you can increase the count number to get more order then 25. Just check some documentation. I think there is still a limit (probably 100 not sure) 

     

    You should these request as pagination request so you always give the number for your search starting point and how many records you want to fetch

     

    Here is an example for your pyhton how to add count and start to your requests, In this example we are searching customers who have "gmail" in their profile and fetching 10 of them from the start of the 10th customer, so it will return 10-19 customer in the search list. So you can tweak these numbers and get the results that you want programmatically.

    import requests

    import json

    url = "https://yourclientdomain.com/s/-/dw/data/v19_1//customer_lists/EUR/customer_search"

    payload = json.d_u_m_p_s({ // I change here please remove "_" becauase Trailhead does not allow the word :D

    "query": {

    "text_query": {

    "fields": [

    "credentials.login"

    ],

    "search_phrase": "gmail"

    }

    },

    "start": 10,

    "count": 10

    })

    headers = {

    'Content-Type': 'application/json',

    'Authorization': 'Bearer aaaaaaaaaaaaa'

    }

    response = requests.request("POST", url, headers=headers, data=payload)

    print(response.text)

     

    Second you can do batch request which means, you can call two different endpoint in one call. In your case it's not needed I guess but you can still use it. If I remember correctly, in one batch request you can call 50 different endpoint in one call. You need to use multipart/mixed request with some unique boundry number(anything you want). And then place all of your requests in the body. Here is an example:

    import requests

    url = "https://yourclientdomain.com/s/-/dw/batch?client_id=yourclientid"

    payload = "--23dh3f9f4\r\nx-dw-content-id: update_customer_1\r\nx-dw-http-method: PATCH\r\nx-dw-resource-path-extension: customer_lists/EUR/customers/00143509\r\n\r\n{\"c_tags\" : [\"test1multiupdate\"]}\r\n--23dh3f9f4\r\nx-dw-content-id: update_customer_2\r\nx-dw-http-method: PATCH\r\nx-dw-resource-path-extension: customer_lists/EUR/customers/00193009\r\n\r\n{\"c_tags\" : [\"test2multiupdate\"]}\r\n--23dh3f9f4--"

    headers = {

    'Content-Type': 'multipart/mixed; boundary=23dh3f9f4',

    'x-dw-client-id': 'your client id',

    'x-dw-http-method': 'GET',

    'x-dw-resource-path': '/s/-/dw/data/v19_1/',

    'Authorization': 'Bearer yourbearertoken'

    }

    response = requests.request("POST", url, headers=headers, data=payload)

    print(response.text)

    I hope this will help your cause :) 

0/9000

🥁 Drumroll, please! Presenting www.promptforce.in 🚀: A free collection of #prompts for your Salesforce #genai needs.🌟 During my research for the #salesforcedevdays conference presentation, I stumbled upon a #challenge - a scarcity of #boilerplate prompts for Salesforce's #genai .So with the help of some weekend #python coding and coffee, I created a database of prompts for Salesforce using #gpt4 . So that you can have boilerplate prompts to #kickstart your journey. And wait, there's more – #promptforce brings you learning treasures to turbocharge your #genai adventures.

Ready to dive in? May the #force be with your #prompts .

 

🥁 Drumroll, please! Presenting www.promptforce.in 🚀: A free collection of for your Salesforce needs.

0/9000

Invitation for Heroku Research

Happy Trailblazer Thursday @Heroku Enthusiasts

 

To help us continue to innovate Heroku, we invite you to join the Heroku Research Program and also our @Salesforce Research Program community ! 

This is an opportunity for customers like yourself to participate in exciting research studies surrounding Heroku and other related products.

By participating in our research program, you have the chance to:

  • Provide input on new features and enhancements
  • Provide input on our Public Product roadmap (Link)
  • Test out products and updates
  • Share your thoughts and ideas with our product team

The program is completely voluntary and requires minimal time commitment. 

 

We’ll ask you to participate in online surveys, webinars, and virtual focus groups — all at your convenience. 

If you are selected, after your participation, you will receive a small gift in appreciation of your time. 

Sign up for the Heroku Research Program here. 

 

Join our Trailblazer Community @Salesforce Research Program to stay on top of upcoming research activities and opportunities !

 

#CommUpdates #CommUpdates#CommUpdates #Heroku #Salesforce Developer #Python #Javascript Code 

0/9000

Episode #72 of the official SF devs podcast just dropped, and it's ADMIN/MANAGER-FRIENDLY, so don't be shy.

https://developer.salesforce.com/podcast/2021/03/episode-072-data-development-and-integrations-with-katie-kodes.html

Devs, share w/ an admin/manager & talk about new ideas for building in your org.  Admins/managers, share w/ a dev & do a lunch-and-chat.  :)  I highly recommend making it a whole lunch series w/ old episodes about the developer-admin crossover through Flow from @Aidan Harding & @Jen Lee, too.

 

Josh & I talked about best practices & concepts around:

...and how all those technologies fit into the essential act of making other people's lives easier with Salesforce.

 

"Developers" is in the name, so don't worry -- we geeked out about OpenAPI, Apex gotchas that experienced developers diving into the world of Salesforce can run into, etc. -- plenty of nerdery to go around.

 

But we made a concerted effort to do it in a way that we hope will be entertaining and informative to non-developers from beginning to end.

 

I hope you learn or dream up something new!

 

 @Salesforce Flow Automation @The Blog Group @* Salesforce Administrators * @* Salesforce Developers * 

Admin-friendly Developer podcast episode

1 comment
0/9000

Hi all,

Has anyone here ever used Marketing Cloud Fuel SDK?

 

I have installed marketing Cloud Fuel SDK using the instructions from Github(https://github.com/salesforce-marketingcloud/FuelSDK-Python.)

I set up the environment variables:

os.environ['FUELSDK_CLIENT_ID']

os.environ['FUELSDK_CLIENT_SECRET']

os.environ['FUELSDK_ACCOUNT_ID']

os.environ['FUELSDK_AUTH_URL']

os.environ['FUELSDK_BASE_API_URL']

os.environ['FUELSDK_DEFAULT_WSDL']

os.environ['FUELSDK_SOAP_ENDPOINT']

 

When I run my python code, i keep getting this error:

 

Unable to validate App Keys(ClientID/ClientSecret) provided: {'error': 'unsupported_grant_type', 'error_description': 'Use "authorization_code" or "refresh_token" or "client_credentials" or "urn:ietf:params:oauth:grant-type:jwt-bearer" as the grant_type.', 

 

Any idea what I could be doing wrong?

3 comments
  1. Apr 13, 2020, 4:00 PM
    @Fabienne Ishimwe

    - Based on the error, it sounds like there is an authentication issue occurring.

    I found this on StackExchange:

    https://salesforce.stackexchange.com/questions/257430/fuelsdk-endpoints-clarification?noredirect=1&lq=1

    I also found the following:

    https://connect2id.com/products/server/docs/api/token

    The first link above is a development resource and may not be 100% correct in regards to fixing the issue, but they are examples of where this error has occurred for other people and what they did. The second link is much more informative in nature versus anything else but addresses this topic. These are just resources I wanted to pass on to you that I found.

    Thank you!

0/9000