web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

Import csv data in a crm online lookup field using powershell

(1) ShareShare
ReportReport
Posted on by 7

Hello,

I have a powershell script which creates crm record by reading the data from .csv file however I am able to insert data in all crm entities except lookup fields.

I am getting below error when try to import data from csv file using powershell. BTW its CRM Online.

Error :- FaultException`1 - Create : si_requestsubtype |=> Invalid value type for attribute: si_requesttype of entity:
si_requestsubtype, Expected Type: lookup, Actual Type: System.String

I would need to convert string to lookup type using powershell. Any help?

My script:-

$conn = Connect-CrmOnlineDiscovery -interactiveMode

$File=Import-Csv -Path "C:\Users\Example.csv"

ForEach ( $row in $File ) {

$FileWorkflowsubType = $row.'Workflow Subtype'
$FileWorkflowType1=$row.'Workflow Type'


New-CrmRecord -conn $conn -EntityLogicalName si_requestsubtype @{"si_requestsubtype"="$FileWorkflowsubType";"si_requesttype"="$FileWorkflowType1"}


}

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 60 Super User 2026 Season 1

#2
Eugen Podkorytov Profile Picture

Eugen Podkorytov 49

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 33 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans