Add-PnPField and -Type Calculated

Highlighted
Microsoft

What's the format for creating calculated fields with AddPnPField? 

 

I'm assuming the -Type should be Calculated.  Like this: Add-PnPField -Type Calculated

 

I have the formula I want to use, I know it works in the field I created manually.  I was going to paste it in, but not sure what format it should go in after Calculated.

 

I'm seeing this error when I add the formula after Calculated:

 

Add-PnPField : A positional parameter cannot be found that accepts argument 'IF(Likelihood='.

 

Thanks

1 Reply
Highlighted

You could look into Add-PnPFieldFromXml it might make things easier. Then the -FieldXml switch needs the Xml. Similar as used by the PnP Templates for the calculated columns.