Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default values for lookup is not showing after running PNP command successfully using Set-PnPField #42

Closed
VijayaRimmalapudi opened this issue Dec 6, 2020 · 1 comment
Assignees

Comments

@VijayaRimmalapudi
Copy link

Default values for lookup is not showing in the library after running PNP command successfully using Set-PnPField. Also will the default values set through PNP shown in the Search results page?

Set-PnPField -List "Listname" -Identity "Columnname" -Values @{DefaultValue="1;#Value"}

@erwinvanhunen
Copy link
Member

You were close :-)

Set-PnPField -List "yourlist" -Identity "ColumnName" -Values @{DefaultValue="Value"}

Eg. do not use the 1;# part, the DefaultValue property of a field is simply text without the index identifier.

You can use the Get-PnPField cmdlet to see the actual default value if you set the default value through the web interface first.

$field = Get-PnPField -List "yourlist" -Identity "YourChoiceField"
$field.DefaultValue

@erwinvanhunen erwinvanhunen removed the bug Something isn't working label Dec 12, 2020
@github-actions github-actions bot closed this as completed Jan 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants