Skip to content

Commit 46b926f

Browse files
committed
updated readme
1 parent 1288731 commit 46b926f

File tree

4 files changed

+37
-16
lines changed

4 files changed

+37
-16
lines changed

ConvertPackage.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ $resources = Import-Csv -Path .\resourceMapping.csv
2727

2828
# Create dist folder if it does not exist
2929
if (-not (Test-Path .\dist)) {
30-
$suppress = New-Item -ItemType Directory -Path .\dist
30+
New-Item -ItemType Directory -Path .\dist | Out-Null
3131
}
3232

3333
for ($k = 0; $k -lt $packages.count; $k++) {

MISC/Move-Lists.ps1

+24-11
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ if ($MigrationType -eq "Export") {
109109
# Select all extended columns nodes based on the Group attribute
110110
# We don't want to migrate extended columns
111111
$extendedColumnNodes = $xml.SelectNodes("//*[@Group='Extended Columns']")
112-
if($extendedColumnNodes -ne $null) {
113-
Write-host "Extended columns count: " $extendedColumnNodes.Count
112+
if ($extendedColumnNodes -ne $null) {
113+
Write-Host "Extended columns count: " $extendedColumnNodes.Count
114114
# Remove each node
115115
foreach ($extendedColumnNode in $extendedColumnNodes) {
116116
$extendedColumnNode.ParentNode.RemoveChild($extendedColumnNode) | Out-Null
@@ -119,27 +119,34 @@ if ($MigrationType -eq "Export") {
119119

120120
# Get all 'Field' nodes with attribute Hidden='TRUE'
121121
$hiddenFields = $xml.SelectNodes("//Field[@Hidden='TRUE']")
122-
if($null -ne $hiddenFields) {
123-
Write-host "Hidden fields count: " $hiddenFields
122+
if ($null -ne $hiddenFields) {
123+
Write-Host "Hidden fields count: " $hiddenFields
124124
# Remove all 'Field' nodes with attribute Hidden='TRUE'
125-
foreach($field in $hiddenFields)
126-
{
125+
foreach ($field in $hiddenFields) {
127126
$field.ParentNode.RemoveChild($field) | Out-Null
128127
}
129128

130129
}
131130

132-
$siteFields = $xml.GetElementsByTagName("pnp:SiteFields")
131+
$siteFields = $xml.GetElementsByTagName("pnp:SiteFields")
132+
133133
# Check if 'SiteFields' node is empty
134-
if ($siteFields.ChildNodes.Count -eq 0) {
135-
# Remove the 'SiteFields' node completely
136-
$siteFields.ParentNode.RemoveChild($siteFields)
134+
if ($null -ne $siteFields) {
135+
if($siteFields.GetType().Name -eq "XmlElementList"){
136+
$siteFields = $siteFields[0]
137+
}
138+
139+
if ( $siteFields.ChildNodes.Count -eq 0) {
140+
# Remove the 'SiteFields' node completely
141+
$siteFields.ParentNode.RemoveChild($siteFields) | Out-Null
142+
}
137143
}
138144

145+
139146
$propertyBagEntries = $xml.GetElementsByTagName('pnp:PropertyBagEntries')
140147
if ($propertyBagEntries -ne $null -and $propertyBagEntries.Count -gt 0) {
141148
for ($i = $propertyBagEntries.Count - 1; $i -gt -1 ; $i--) {
142-
$supress = $propertyBagEntries[$i].ParentNode.RemoveChild($propertyBagEntries[$i])
149+
$propertyBagEntries[$i].ParentNode.RemoveChild($propertyBagEntries[$i]) | Out-Null
143150
}
144151
}
145152

@@ -150,7 +157,13 @@ if ($MigrationType -eq "Export") {
150157
foreach ($title in $titles) {
151158
# Get the latest list item form layout. Footer, Header and the Body:
152159
$list = Get-PnPList $title -Includes ContentTypes
160+
if ($list -is [array]) {
161+
$list = $list[0]
162+
}
153163
$contentType = $list.ContentTypes | Where-Object { $_.Name -eq "Item" }
164+
if($null -eq $contentType){
165+
continue
166+
}
154167
$contentType.ClientFormCustomFormatter | Set-Content .\$title.json
155168
}
156169
}

MISC/PS-Forms.ps1

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ function Get-FormArrayItem {
126126

127127
$ComboBox.DropDownStyle = [System.Windows.Forms.ComboBoxStyle]::DropDown;
128128
foreach($item in $items){
129-
$suppress = $ComboBox.Items.add($item)
129+
$ComboBox.Items.add($item) | Out-Null
130130
}
131131
$ComboBox.SelectedIndex = 1
132132

@@ -144,7 +144,7 @@ function Get-FormArrayItem {
144144
$Panel.Height += $spaceBetweenControls
145145

146146
function Combobox{
147-
if ($ComboBox.SelectedItem -eq $null){
147+
if ($null -eq $ComboBox.SelectedItem){
148148
$OKButton.Enabled = $false
149149
}else{
150150
$OKButton.Enabled = $true

README.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![SharePoint Online](https://img.shields.io/badge/SharePoint-Online-yellow.svg)
22
![Windows](https://img.shields.io/static/v1?label=OS&message=Windows&color=green)
3-
![Version](https://img.shields.io/static/v1?label=Version&message=3.9.5&color=white)
3+
![Version](https://img.shields.io/static/v1?label=Version&message=3.9.6&color=white)
44

55

66
# Flow & Power Apps Migrator
@@ -182,7 +182,15 @@ SharePoint List forms customized with Power Apps can be migrated if you follow t
182182

183183
# Latest Updates
184184

185-
### 3.9.4 Version - 2023-08-6
185+
### 3.9.6 Version - 2023-09-06
186+
#### Changes
187+
- Addressed issue #66 [You cannot call a method on a null-valued expression](https://github.com/Zerg00s/FlowPowerAppsMigrator/issues/66)
188+
189+
### 3.9.5 Version - 2023-08-30
190+
#### Changes
191+
- Removed the REST API call that was causing 403 error for some users.
192+
193+
### 3.9.4 Version - 2023-08-06
186194
#### Changes
187195
- The pnp:SiteFields node is now automatically removed from the Lists.xml PnP provisioning template if it's empty. An empty node was causing the "invalid template" errors.
188196

0 commit comments

Comments
 (0)