cancel
Showing results for 
Search instead for 
Did you mean: 

How do I import ContentNotes with DTV?

michael-wtds
Frequent Contributor

Are there any posts already written for DTV on how to insert notes with to the ContentNote object?

I've been trying to figure out to create new notes for the ContentNote object, which appears to require a file reference when importing.   Is there a way to do this import with DTV?

The only workaround I've found so far is to import to legacy Notes, and then use Salesforce Lab's Magic Mover to convert the classic notes to the new lightning notes.

1 ACCEPTED SOLUTION

Pugs_Validity
Validity Team Member
Validity Team Member

Hey @michael-wtds - Checking in to make sure you saw yesterday's release of 5.37.1. You can now import content documents. Instructions are outlined on this document. Let us know if you have any questions!

View solution in original post

5 REPLIES 5

Pugs_Validity
Validity Team Member
Validity Team Member

Hey @michael-wtds - I know this was discussed during yesterday's Office Hours briefly but I wanted to follow up. This feature will be available on the upcoming 5.37 DTV release. I'll be able to provide further detail as soon as the team is done putting the finishing touches on it. I'll follow up as soon as it's released!

Pugs_Validity
Validity Team Member
Validity Team Member

Hey @michael-wtds - Checking in to make sure you saw yesterday's release of 5.37.1. You can now import content documents. Instructions are outlined on this document. Let us know if you have any questions!

@Pugs_Validity Thank you for bringing this to my attention, and I hope to test this out later this week.

It does look like I'm going to need to find some scripting, probably with python, to create individual text files from an excel notes field.  So, if you have any solutions for doing this, please let me know. 

And if I find anything that works, I'll be sure to post it for reference.

All the best,
Michael

michael-wtds
Frequent Contributor

@Pugs_Validity I finally had a chance to put the content notes import to work.   The hardest part is creating the individual files from excel, but I did finally get a python script to work to create my individual files.

For reference, my source xlsx file had the following 2 columns that were used to create individual files using python -

ContentNotePath
D:\WTDS LLC\Clients\XYZ\GTE Nashville Dec 8-11 2024\1.txt
D:\WTDS LLC\Clients\XYZ\GTE Nashville Dec 8-11 2024\2.txt
D:\WTDS LLC\Clients\XYZ\GTE Nashville Dec 8-11 2024\3.txt
...

And the file contents are in the column with this example data, where html paragraphs were used to create line breaks for the note body -

Note Content
Company / Organization Name<p>ABC Wealth Advisors<p>https://abcwealth.com/<p><p>Mike Peach<p>Head of Portfolio Management<p><p>Business Descrip....

Company / Organization Name<p>XYZ Wealth, LLC<p>http://www.xyzwealth.com<p><p>Sarah Connor<p>CEO<p>...

Company / Organization Name<p>AAA Trust Company<p>https://AAATrust.com/<p><p>Ace Ventura<p>VP of Adviser...

And then this is the python script that created individual txt files -

 
Pyton-CreateNoteFiles.py
import pandas as pd
import os

# Load the Excel file
# Using a raw string to handle file path
file_path = r"D:\\WTDS LLC\\Clients\\XYZ\\GTE Nashville Dec 8-11 2024\\ContentNotes.xlsx"
df = pd.read_excel(file_path)

# Loop through each row in the DataFrame to create individual text files
for index, row in df.iterrows():
    # Get the file path and content
    note_path = row['ContentNotePath']
    note_content = row['Note Content']

    # Ensure that the directory for the file path exists
    directory = os.path.dirname(note_path)
    os.makedirs(directory, exist_ok=True)

    try:
        with open(note_path, 'w', encoding='utf-8') as file:
            file.write(note_content)
    except Exception as e:
        print(f"Failed to write file {note_path}: {e}")

print("All text files have been created successfully.")

 

AnthonyValidity
Validity Team Member
Validity Team Member

For posterity:

You can accomplish this with Excel on Windows (MacOS does not allow for this)

• Open a new Excel doc
• Go to the Data tab.
• Click on Get Data > From File > From Folder.
• Then pick the folder you want to export from.

Anthony Lardiere Jr
Senior Customer Success Manager