Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create update-image-by-asset-id.gs #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

doylegrant
Copy link

Create new script to update images of assets using image URL's.

Create new script to update images of assets using image URL's.
@snipe
Copy link
Member

snipe commented Apr 17, 2024

This would really just be a filename, not a full image URL, no?

@doylegrant
Copy link
Author

doylegrant commented Jun 21, 2024

This would really just be a filename, not a full image URL, no?

Sorry for the late response. The image would need to be hosted publicly online somewhere and this will basically bulk upload images for their associated asset id in Snipe-it.

What I did was export my list of assets from Snipe-it by Asset ID and Model Number. Then I had a formula search the model number on Yahoo images and return the link to the first result. Then I ran through the images to make sure the first image result looked correct, otherwise I would manually replace the link. Then on a second tab, I brought over just the Asset Id's and image URL's and ran the script. Script will pull the image, base64 encode, and update the database with the base64 encoded value. Which will be viewable in Snipe-it.

This is roughly how my sheet was set up.
https://docs.google.com/spreadsheets/d/1L9hX2AfDSEk6XpGiaoUNI_hnnTEt_xKhBPSROADZ--M/edit?usp=sharing

Google Docs
Verify Images

Asset Id,Model,Check Image,Link
0001,YZY-00001,https://tse3.mm.bing.net/th?id=OIP.wMpJ6sB7XXCG_lVmQK-CkAHaHa&pid=Api&P=0&w=300&h=300
0002,Lenovo 21HMCTO1WWUS1,<a href="https://sp.yim...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants