cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PowerBI87
Helper I
Helper I

IF Null user input help

Hi All, 

 

I have a flow connected to a button in SharePoint. When the user clicks it they are prompted to enter links. The fields are not mandatory but if they do not populate the fields, the flow fails. I want to write an if statement in the create item step to avoid this. 

 

Can anyone help with this?

 

PowerBI87_0-1595255277179.png

PowerBI87_1-1595255332015.png

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @PowerBI87 

 

You can check out this post as well: https://www.bythedevs.com/post/how-to-pass-a-null-value-as-an-input-while-using-a-manual-trigger-in-...

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

8 REPLIES 8
Rahber
Solution Sage
Solution Sage

You can use this dynamic expression

if(empty(items('Apply_to_each')?['Status']),'Empty',items('Apply_to_each')?['Status'])

items('Apply_to_each')?['Status'] is my SharePoint variable int this case, you can replace with yours

 

Please click Accept as Solution if it resolved your problem or give it a Thumbs Up if it helped you in anyway this will allow other people to search correct solutions effectively.

Thanks,

Rahber

I tried this but its not working. Not sure if my syntax is off.

 

PowerBI87_0-1595268060723.png

 

No Sir, not this way.

 

This needs to be a dynamic expression.  and to know the expression for share point value however on the share point item and you will see the value that you have to use in dynamic expression

expression.PNG

 

Please click Accept as Solution if it resolved your problem or give it a Thumbs Up if it helped you in anyway this will allow other people to search correct solutions effectively.

Thanks,

Rahber

I see, I am not able to grab dynamic content from "For a Selected Item", only "Get Item"

 

PowerBI87_0-1595277190299.png

PowerBI87_1-1595277251918.png

 

Tried this:

PowerBI87_1-1595279914163.png

 

PowerBI87_0-1595279883683.png

 

if(isblank(variables('FW')),'Empty',items()?[variables('FW')])
 
Getting error " 
Flow save failed with code 'InvalidTemplate' and message 'The template validation failed: 'The template action 'Compose_2' at line '1' and column '9641' is not valid: "The template language function 'items' must have at least one parameter.".'.'"
 

 

Hi @PowerBI87 

 

You can check out this post as well: https://www.bythedevs.com/post/how-to-pass-a-null-value-as-an-input-while-using-a-manual-trigger-in-...

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Use

 

if(empty(variables('FW')),'Empty',variables('FW'))

items()?[variables('FW')] is not a correct expression

 

Please click Accept as Solution if it resolved your problem or give it a Thumbs Up if it helped you in anyway this will allow other people to search correct solutions effectively.

Thanks,

Rahber

Thank you so much for this!

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (4,491)