0

I have a flow whose trigger is the SharePoint trigger named:

For a selected file

The default behavior of this trigger is that when a file is selected, the flow is available under the Automate menu.

By default, if you select more than one item, the flow is not visible under the Automate menu.

In order to make it easier for users to run the flow, I have added a button in a column to run the flow.

This is a common modification which is documented by Microsoft here:

Create a button to launch a flow

This works well, however if a user selects more than one item , the 'buttons' are still visible.

This can confuse the user as they will think it is possible to run the flow on all the selected items (when this is actually not possible).

Is it possible to hide the 'buttons' displayed by column formatting when more than one item is selected?

I do not currently have access to SharePoint framework modifications etc., so am looking for a solution that uses plain JSON column formatting.

0

1 Answer 1

0

Unfortunately, JSON column formatting does not provide us the number of items selected in list view.

So, you cannot conditionally show/hide the button when more than one item is selected in list view.


Microsoft recently introduced @isSelected token in JSON formatting which only returns true when an item is selected and not the number of items selected in list view.

Reference: SharePoint: Highlight selected list item rows using JSON formatting


As of now, Microsoft only provides this type of information only in Command bar customizations using selectionModes which has below supported values:

  • NoSelection
  • SingleSelection
  • MultiSelection

Documentation: Command bar customization syntax reference - selectionModes

1
  • Hi @user1063287, does this answer your question? If yes, Please Upvote(^) and accept as an Answer as it helped you & it will help others with similar question in future to find the correct answer easily. Commented Aug 9, 2023 at 13:18

Your Answer

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

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