cli-microsoft365 icon indicating copy to clipboard operation
cli-microsoft365 copied to clipboard

New command: m365 spp autofillcolumn apply

Open mkm17 opened this issue 1 year ago • 7 comments

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

mkm17 avatar Jul 30 '24 16:07 mkm17

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.
  • isEnabled why do we have this option? Can we disable it as well?

Jwaegebaert avatar Jul 31 '24 07:07 Jwaegebaert

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.

mkm17 avatar Aug 04 '24 09:08 mkm17

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 avatar Aug 07 '24 20:08 Jwaegebaert

@Jwaegebaert Yes you can assign me to this one as well

mkm17 avatar Aug 09 '24 20:08 mkm17

All yours @mkm17!

Jwaegebaert avatar Aug 13 '24 07:08 Jwaegebaert

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!

Jwaegebaert avatar Sep 26 '24 12:09 Jwaegebaert

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?

mkm17 avatar Oct 06 '24 10:10 mkm17

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?

martinlingstuyl avatar Jan 15 '25 12:01 martinlingstuyl

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']?

mkm17 avatar Jan 16 '25 16:01 mkm17

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 ?

martinlingstuyl avatar Jan 17 '25 12:01 martinlingstuyl

I'm not super experienced with using Syntex columns, but what @martinlingstuyl says, makes sense to me.

milanholemans avatar Jan 17 '25 22:01 milanholemans

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

Adam-it avatar Jan 19 '25 20:01 Adam-it

@martinlingstuyl , ok will make the changes accordingly in the existing #6460 PR. :) Thanks for suggestion.

mkm17 avatar Jan 19 '25 22:01 mkm17

@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?

martinlingstuyl avatar Jan 20 '25 08:01 martinlingstuyl