Showing results for 
Search instead for 
Did you mean: 
Advocate III
Advocate III

How to: make certain Outputs non-required on Sharepoint 'For a selected item' trigger

Wanted to share an issue I recently ran into, and a quick fix. 


By default, all of the outputs you add to a SharePoint 'For a selected item' trigger are required, and there's no method to change the outputs to non-required via the UI. However, if you need a non-required output and you're willing to get into the json, you can change an output to non-required with the following steps:


  • Export your Flow
  • Edit the 'Definition.json' in the export zip package to remove the output fields you want to make non-required from the "required" property of the 'For a selected item' trigger 
  • Re-import the Flow package

This makes the fields optional when the end user triggers the Flow.


Just be aware that the 'For a selected item' trigger will not pass any fields that were left blank into the Flow. So, your Flow needs to check for the presence of a field in the trigger output (using a contains()) before attempting to manipulate the field contents.

Community Support
Community Support

Hi @StevenWade,


Thanks for sharing.

It seems that what you shared works perfectly.


Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks! Was just sharing here in case others had the same issue.

Thank you for this - was searching for this very thing and ran across your article.

Advocate I
Advocate I



I am able to alter the JSON file ok and that works great and I have 3 optional emails now in my flow. I understand what he means when he says "Just be aware that the 'For a selected item' trigger will not pass any fields that were left blank into the Flow." So how do I check that a field doesn't exist in the trigger output? In a condition I have tried:


@contains(triggerBody(), triggerBody()?['email'])


@contains(triggerBody()?['entity']?['value'], triggerBody()?['email'])


So bottom line I just need help with figuring out how to tell if the field (in this case email) object is missing from the "For a selected item" object


 Anyone have any ideas? Any help will be appreciated


Thank you

Got the correct syntax from @StevenWade


My expression was too complex I guess, the below worked for me.


@contains(triggerBody(), '[email]')


He also referenced another article that says this will work:


@contains(triggerBody(), 'email')


HTH - Cheers 🙂

Just be aware that you are looking for a literal text string within the trigger body -- @contains() is not JSON aware. That means you need to ensure some uniqueness within your variable names. In your 'email' example, @contains() would return TRUE if someone populated "email', 'email1', or 'email2'; or, if they just used the word 'email' in one of the text responses. Basing your conditional tests on generic variable names may generate errors or unexpected results.


This is a workable hack, and I've used it in several different scenarios. Just make sure you're using unique variable names.

Good advice ty 🙂

Helpful resources

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Kudoed Authors
Users online (2,949)