Wix import new products via CSV file - csv

Good day,
I've tried to import new products to my WIX website via a CSV file that I downloaded, but when I add a new product to this file I need to insert the handleId code, how do I get this code if the new product?

I was just recently wondering this as well and upon having a look at the wix-import-template, I noticed that all handleIDs of the products were simply Product_1, Product_2 and so on and so forth... (all varients of a product have to have the exact same handle as the product they are a part of so:
Product_1,Product,otherAttributes...
Product_2,Product,otherAttributes...
Product_2,Variant,otherAttributes...
etc...
Therefore, if you are using code, you can simply use a for-loop and insert the i-value into the string (if you only have products and no variants, will have to adjust it otherwise)
Wish you a nice day and I hope this helps!
Greetings, Thomas

Related

How to decouple variable names in external files and the code?

Imagine I have an external file dates.csv in the following format:
Name
Date
start_of_fin_year
01.03.2022
end_of_fin_year
28.02.2023
Obviously, the file may get updated in the future, and the date may change. I create a piece of code that checks the file periodically to extract needed dates and put them into the DB/variables. Roughly speaking, I have this pseudocode:
start_of_fin_year = SELECT Date FROM table WHERE Name = 'start_of_fin_year'
The problem I face: my code will break if I or someone else changes the name in the table. How do I prevent this?
FYI this is a personal project that I developed on my own, but I will have to give access to .csv files to others so they can update info. I'm afraid they may accidentally change the names, so that's why I'm worried.

Mass Upload Files To Specific Contacts Salesforce

I need to upload some 2000 documents to specific users in salesforce. I have a csv file that has the Salesforce-assigned ContactID, as well as a direct path to the files on my desktop. Each contact's specific file url has been included in the csv. How can I upload them all at one and, especially, to the correct contact?
You indicated in the comments / chat that you want it as "Files".
The "Files" object is bit more complex than Attachments, you'll need to do it in 2-3 steps. What you see as a File (you might see it referred to in documentation as Chatter Files or Salesforce Content) is actually several tables. There's
ContentDocument which can be kind of a file header (title, description, language, tags, linkage to many other areas in SF - because it can be standalone, it can be uploaded to certain SF Content Library, it can be linked to Accounts, Contacts, $_GOD knows what else)
ContentVersion which is well, actual payload. Only most recent version is displayed out of the box but if you really want you can go back in time
and more
The crap part is that you can't insert ContentDocument directly (there's no create() call in the list of operations) .
Theory
So you'll need:
Insert ContentVersion (v1 will automatically create for you parent ContentDocuments... it does sound bit ass-backwards but it works). After this is done you'll have a bunch of standalone documents loaded but not linked to any Contacts
Learn the Ids of their parent ContentDocuments
Insert ContentDocumentLink records that will connect Contacts and their PDFs
Practice
This is my C:\stacktest folder. It contains some SF cheat sheet PDFs.
Here's my file for part 1 of the load
Title PathOnClient VersionData
"Lightning Components CheatSheet" "C:\stacktest\SF_LightningComponents_cheatsheet_web.pdf" "C:\stacktest\SF_LightningComponents_cheatsheet_web.pdf"
"Process Automation CheatSheet" "C:\stacktest\SF_Process_Automation_cheatsheet_web.pdf" "C:\stacktest\SF_Process_Automation_cheatsheet_web.pdf"
"Admin CheatSheet" "C:\stacktest\SF_S1-Admin_cheatsheet_web.pdf" "C:\stacktest\SF_S1-Admin_cheatsheet_web.pdf"
"S1 CheatSheet" "C:\stacktest\SF_S1-Developer_cheatsheet_web.pdf" "C:\stacktest\SF_S1-Developer_cheatsheet_web.pdf"
Fire Data Loader, select Insert, select showing all Salesforce objects. Find ContentVersion. Load should be straightforward (if you're hitting memory issues set batch size to something low, even 1 record at a time if really needed).
You'll get back a "success file", it's useless. We don't need the Ids of generated content versions, we need their parents... Fire "Export" in Data Loader, pick all objects again, pick ContentDocument. Use query similar to this:
Select Id, Title, FileType, FileExtension
FROM ContentDocument
WHERE CreatedDate = TODAY AND CreatedBy.FirstName = 'Ethan'
You should see something like this:
"ID","TITLE","FILETYPE","FILEEXTENSION"
"0690g0000048G2MAAU","Lightning Components CheatSheet","PDF","pdf"
"0690g0000048G2NAAU","Process Automation CheatSheet","PDF","pdf"
"0690g0000048G2OAAU","Admin CheatSheet","PDF","pdf"
"0690g0000048G2PAAU","S1 CheatSheet","PDF","pdf"
Use Excel and magic of VLOOKUP or other things like that to link them back by title to Contacts. You wrote you already have a file with Contact Ids and titles so there's hope... Create a file like that:
ContentDocumentId LinkedEntityId ShareType Visibility
0690g0000048G2MAAU 0037000000TWREI V InternalUsers
0690g0000048G2NAAU 0030g000027rQ3z V InternalUsers
0690g0000048G2OAAU 0030g000027rQ3a V InternalUsers
0690g0000048G2PAAU 0030g000027rPz4 V InternalUsers
1st column is the file Id, then contact Id, then some black magic you can read about & change if needed in ContentDocumentLink docs.
Load it as insert to (again, show all objects) ContentDocumentLink.
Woohoo! Beer time.
Your CSV should contain following fields :
- ParentID = Id of object you want to link the attachment to (the ID of the contact)
- Name = name of the file
- ContentType = extension(.xls or .pdf or ...)
- OwnerId = if empty I believe it takes your user as owner
- body = the location on your machine of the file (for instance: C:\SFDC\Files\test.pdf
Use this csv to insert the records (via data loader) into the Attachment object.
You will then see for each contact, that records have been added to the 'Notes & Attachments' related list.

JIRA Importing/Updating subtasks

Im somewhat new to JIRA (skill level novice)
Jira v 6.4.8
JIM v 7.0.12
I am attempting to import issues using the Issue->Import from CSV (bulk create tool)
I have a defined ticket CM-1 as a parent ticket. A generic CSV looks like this
Summary, Parent ID, Issue ID
CM-2, CM-1,
CM-3, CM-1,
CM-4, CM-1,
The first import works successfully and maps as children to CM-1
We attempt to re-import (to update the ~100 fields that changed overnight, not shown in this example for clarity)
Summary, Parent ID, Issue ID
CM-2, CM-1, CM-2
CM-3, CM-1, CM-3
CM-4, CM-1, CM-4
We encounter an issue where new subtasks are created, and nothing is updated.
I have also tried to map the Issue ID found when a I inspect the subtask tickets XML. It looks something like this
<item>
<title>[CM-2] CM2</title>
<link>
https://website.net/browse/CM-2
</link>
<project id="11902" key="CM">Change Management</project>
<description>CM-2 Description</description>
<environment/>
<key id="191147">CM-2</key>
<summary>CM-2</summary>
Specifically the ""
So that would look like
Summary, Parent ID, Issue ID
CM-2, CM-1, 191147
CM-3, CM-1, 191148
CM-4, CM-1, 191149
Once again we see new issues created and no updates performed. I've read the documentation, searched their 'Answer's' asked multiple questions, searched everywhere, but im not seeing any solutions. We literally need to update thousands of tickets, at least once a day - we don't have the manpower to perform this task any other way.
Criteria:
This needs to be able to be performed by an end user or a team lead, they will have access to the bulk import tool (Bulk create) from the Issues-Import issue From CSV link but will not have access to the administrator level external project imports.
I know this isn't an ideal long term solution, and would like to investigate a method to further automate this but we need a solution short term (this).
I appreciate any and all responses. We are importing from a very outdated instance of remedy that's going to remain in use for the next ~3+ years.
Thanks,
Jacob
First of all, if you want to update issues via CSV, you must include an 'Issue Key' column and, during import, map it to the issue key field (CM-1,CM-2 etc. are issue keys in your example). Otherwise every import will generate new issues in JIRA.
The 'Issue ID' and 'Parent ID' columns refer to internal IDs (not issue keys). For adding/updating sub-tasks, you need to figure out the ID of the parent (see below), and in the CSV, write the parent id in the 'parent ID' column, and leave the 'issue ID' value empty. This is explained in the 'Creating sub-tasks' section here.
Figuring out the id of an existing JIRA issue is somewhat tricky (unless you import them from the beginning with your own internal ID which has some sense). An easy way from the GUI is to right click the Edit button and choose 'open in new tab'. Then, the URL of the edit page will include the id (e.g. http://jira-srv/secure/EditIssue!default.jspa?id=91796).
If you need to automate it, you will have to resort to directly querying the database (unless someone else can offer you a better way... as far as i know the REST API does not expose it). See the discussion here if you want details.

translate html table to csv

So.. I am a little confused on this problem myself so I am turning to the one place I know I am certain to find help!
I have a shopping cart where in order to purchase something a user must first fill out a form. At the end I am displaying the information they entered in the form along with the product they are purchasing, how much they are paying and any sort of modifiers the product might have (like size, color, shipping etc etc). I have a third party company that then needs to retrieve that information in a CSV file.
Any ideas on how this can be achieved. I am new at this sort of thing so I apologize if I may have missed this somewhere else on the forum.
Thanks!
Jamie
This is actually not too hard! A CSV files is just a comma separated values file.
Whatever you are using as a backend (PHP, c#, c) you can write to a file like so:
CustomerID, Name, Item1
1, John, Table
and that would appear in excel as CustomerID Name and Item1 as the header row and 1, John, Table as the first record. Make sure that when you create the file you call it MyFile.CSV so it is associated with Excel by windows!
Look here for how to properly format your CSV file!
http://creativyst.com/Doc/Articles/CSV/CSV01.htm
EDIT:
I see now you say HTML table so in the case you have no server code access I direct you here for more info.
Export to csv in jQuery

Best way to use a custom table in a relationship (in ExpressionEngine)?

So, I’m a bit on how to use a separate table in a relationship, or something like that…
I have a table with around 5000 hotels called exp_h_hotels.
On my website, I use the pages module to create a static subpage for each part of the country. I want to list all hotels that belong to a specific region.
I have understood that I can’t do something like this (using ExpressionEngine tags with the query module):
{exp:query sql="SELECT * FROM exp_h_hotels WHERE h_regionname ='{regionname}'"}
{hotel_name}
{/exp:query}
Anyone knows the best way to go forward with this?
I have looked into using the ExpressionEngine API to insert the data into a channel – however, I get the feeling that it wouldn’t be optimal to flood the channel entries table with 5000 posts with 14-20 fields with data each.
There's no reason why this shouldn't work as you expect, so long as your exp:query tag is inside your channel:entries tag:
{exp:channel:entries channel="pages" limit="1"}
<h1>Hotels in {regionname}</h1>
<ul>
{exp:query sql="SELECT * FROM exp_h_hotels WHERE h_regionname ='{regionname}'"}
<li>{hotel_name}</li>
{/exp:query}
</ul>
{/exp:channel:entries}
However, for the long-term, importing your hotels into a new channel in EE is a much better plan. You could export from your database to CSV (using phpMyAdmin perhaps) and then import into EE using DataGrab. Nothing wrong with adding 5000 new entries to EE.