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

Announcements

No record found.

News and Announcements icon
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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 197 Super User 2026 Season 1

#2
CU11031447-0 Profile Picture

CU11031447-0 100

#3
NeerajPawar Profile Picture

NeerajPawar 70

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans