Programatically update/delete cards

user09644
user09644 Member
edited March 2023 in Scheduled Reports

I have a python script which I use in conjuntion with the DomoStats Activity Log, Python SDK, to classify cards that are abandoned or otherwise need to be deleted. In our instance, this is close to 1000 cards. I do not see a way to interact with cards at the API level. Additionally, I am trying to rename the cards that we are keeping to fit a standardized naming format and autofill in the description field.

I really do not want to manually do this for all of these cards. Is there a way to programmatically achieve this?

Tagged:

Best Answers

  • ST_Superman
    ST_Superman Domo Employee
    Answer ✓

    Have you investigated the CLI tool? If you have the list of cards you want deleted, the CLI should do the trick.

    I think you would need to reach out to your Customer Success Manager to get the install file. Ask them for the Command Line Interface tool.

  • GrantSmith
    GrantSmith Coach
    Answer ✓

    Hi @user09644

    As for using the pydomo SDK it doesn't expose the APIs for cards at this time. As such they're not supported. As @ST_-Superman-_ mentioned you could attempt to utilize the Java CLI and the 'delete-card' command. You might want to also use the 'backup-card' command first in case you accidentally remove a card you wanted to keep. There's also a 'rename-card' command to rename cards.


    You can create a script of commands to run via the CLI and pass it in as parameter so you don't have to run it multiple times.

    java -jar domoUtil.jar -e "path_to_file.txt"
    


    You can download the CLI tool from Admin -> Tool Downloads in your instance.

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**

Answers

  • ST_Superman
    ST_Superman Domo Employee
    Answer ✓

    Have you investigated the CLI tool? If you have the list of cards you want deleted, the CLI should do the trick.

    I think you would need to reach out to your Customer Success Manager to get the install file. Ask them for the Command Line Interface tool.

  • GrantSmith
    GrantSmith Coach
    Answer ✓

    Hi @user09644

    As for using the pydomo SDK it doesn't expose the APIs for cards at this time. As such they're not supported. As @ST_-Superman-_ mentioned you could attempt to utilize the Java CLI and the 'delete-card' command. You might want to also use the 'backup-card' command first in case you accidentally remove a card you wanted to keep. There's also a 'rename-card' command to rename cards.


    You can create a script of commands to run via the CLI and pass it in as parameter so you don't have to run it multiple times.

    java -jar domoUtil.jar -e "path_to_file.txt"
    


    You can download the CLI tool from Admin -> Tool Downloads in your instance.

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**
  • @GrantSmith @ST_-Superman-_

    Thanks for the comments. I'm trying to authenticate into the Domo CLI. I am able to successfully do it in my developer sandbox instance, but can not in the production version of Domo. I am a major-domo and not an admin. Is there anything special that I need to do to authenticate if my org uses SSO? For the test case authenticating into the developer sandbox I issued and used a token.

  • You need a Token for authentication which, depending on your permissions you or an Admin would need to create on your production environment.

    Note that the CLI will authenticate as the user who created the token

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**
  • Got it - I was following along in the documentation and the first example made it seem like I could connect without a token. Thanks!

    Example

    connect -u jim.smith@xyzcompany.com -p abc123 -s xyzcompany.domo.com

  • For clarification for others who might read this thread.

    Username and password authentication with the CLI isn't an option with Single Sign On (SSO) as you're not authenticating with Domo but rather your own system. If you used direct sign on then username and password authentication is an option.

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**