New command: m365 spp autofillcolumn apply
Usage
m365 spp autofillcolumn apply [options]
Description
Applies the autofill option to the selected column.
Options
| Option | Description |
|---|---|
-u, --siteUrl <siteUrl> |
The URL of the target site. |
--listTitle [listTitle] |
The title of the library on which to apply the model. Specify either listTitle, listId, or listUrl but not multiple. |
--listId [listId] |
The ID of the library on which to apply the model. Specify either listTitle, listId, or listUrl but not multiple. |
--listUrl [listUrl] |
Server or web-relative URL of the library on which to apply the model. Specify either listTitle, listId, or listUrl but not multiple. |
-c, --column <column> |
ID of the column to which the autofill option will be assigned. |
--prompt <prompt> |
The text in natural language that will be used to extract specific information or generate information from files within a SharePoint library. |
Examples
Applies an autofill column on a selected column to a document library based on the list id.
m365 spp autofillcolumn apply --siteUrl "https://contoso.sharepoint.com/sites/ContentCenter" --listId "7645e69d-21fb-4a24-a17a-9bdfa7cb63dc" --columnId "1045e69d-21fb-4214-a25a-9bdfa7cb63a2" --prompt "Write a 2-line summary of the document"
Applies an autofill column on a selected column to a document library based on the list title.
m365 spp autofillcolumn apply --siteUrl "https://contoso.sharepoint.com/sites/ContentCenter" --listTitle "Documents" --column "1045e69d-21fb-4214-a25a-9bdfa7cb63a2" --prompt "Write a 2-line summary of the document"
Applies an autofill column on a selected column to a document library based on the list url.
m365 spp autofillcolumn apply --siteUrl "https://contoso.sharepoint.com/sites/ContentCenter" --listUrl '/Shared Documents' --column "1045e69d-21fb-4214-a25a-9bdfa7cb63a2" --prompt "Write a 2-line summary of the document"
Additional Info
This endpoint should be used -> _api/machinelearning/SetSyntexPoweredColumnPrompts
with body:
{
"docLibId": "{8a6027ab-c584-4394-ba9c-3dc4dd152b65}",
"syntexPoweredColumnPrompts": "[{\"columnId\":\"13c5ebaa-a843-468f-9706-660cd3fc9011\",\"columnName\":\"Education\",\"prompt\":\" Prompt\".\",\"isEnabled\":true}]"
}
link Currently, autofill columns are available for the following column data types:
- Text
- Multiple lines of text
- Number
- Yes/No
- Date and time
- Choice
- Hyperlink
- Currency
Thanks for speccing this out @mkm17. I've a few comments:
- It would be nice to have a bit more descriptive description for the last three options.
-
isEnabledwhy do we have this option? Can we disable it as well?
Hi @Jwaegebaert, Thank you very much for the comments. You are right; maybe we can remove the isEnabled option, as we can assume that someone would like to enable this option when they apply it to the column. For this reason, I have changed the name of this command from "set" to "apply."
The isEnabled option and prompt can be added to the "set" command to update the properties of autofill for the column.
Good approach @mkm17! apply seems like a better way for this command. I've no further comments, so we should be able to move forward. Do you want to take it from here, or should we open it up?
@Jwaegebaert Yes you can assign me to this one as well
All yours @mkm17!
Hey @mkm17, thank you for all the hard work you’ve put in, it’s really appreciated! We’ve noticed that you have several issues assigned that haven't yet been created with a PR. To ensure everyone has a chance to get involved, especially with Hacktoberfest, I’ll be unassigning you from some of these issues.
We recommend focusing on 1 to 2 issues at a time. Once you’ve submitted a PR for an issue, you can easily claim another open one. This approach helps you manage the workload more effectively and ensures you can give each task the attention it needs.
Thanks again for your continued contributions!
Hi @Jwaegebaert, I have submitted two pull requests for my last open issues, so I am ready to take on the next two. Can I take this back?
I'm a bit late to the party here, but are we sure that using apply is better than using set?
We try to stick to the same verbs across the codebase, only deviating from them if there's a really good reason.
I'm doubting whether that's the case here.
Aside from that: apply seems to me rather vague.
And on an earlier discussion: if we can enable/disable autofill on a column we should definitely expose that I think. So including --isEnabled as an option would make sense in my eyes.
Any comments from you guys? @mkm17, @pnp/cli-for-microsoft-365-maintainers?
Hi @martinlingstuyl, what do you think about renaming this command to add and adding a new one spp autofillcolumn set ? Or even extending the existing spo field set command with the option autofillColumn ['Enabled', 'Disabled']?
I'd personally vote for using m365 spp autofillcolumn set. And also to include --enabled here as that makes sense from sp premium point of view. We're not really adding anything, but updating something existing. And as this autofill behavior can be disabled set would make more sense as well from that reason. --prompt should however be made optional, because when disabling using --enabled false it would not be logical to add the prompt.
Any feedback @pnp/cli-for-microsoft-365-maintainers? @Jwaegebaert ?
I'm not super experienced with using Syntex columns, but what @martinlingstuyl says, makes sense to me.
I would also stick with @martinlingstuyl suggestion but I have very little experience with SharePoint Premium features as it is more admin oriented part of SP and I didn't have any side/dev project that needed to do anything with that part of SharePoint
@martinlingstuyl , ok will make the changes accordingly in the existing #6460 PR. :) Thanks for suggestion.
@mkm17, if the prompt is empty and enabled is true it should maybe only throw an error if a prompt has not already been configured.
In such a scenario you could call GetSyntexPoweredColumnPrompts to see if the column has already been configured and is just in a disabled state. What do you think?