1

how do get data of this selected item by clicking on ShortLink which in left side of Automate in list view command extensions

How can I get data of this selected item by clicking on ShortLink which is at left side of Automate button in list view command bar at the top of the list?

1

1 Answer 1

0

You can get the data of selected list item on button click using onExecute() method in SPFx List view command set.

For example:

@override
public onExecute(event: IListViewCommandSetExecuteEventParameters): void {
    //Get selected list item(s)
    let selectedListItems = event.selectedRows;
}

If you want the first/single item selected, you can use:

@override
public onExecute(event: IListViewCommandSetExecuteEventParameters): void {
    //Get first selected list item
    let selectedListItem = event.selectedRows[0];
}

Check this SPFx sample for detailed code and more information: JustALinkCommandSet.ts

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.