cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

How to write an expression for adding an item from SP List into the Planner description if the item field in SP List is not required?

Hi PowerUsers,
It's my first post here. I'm not an expert in Power Automation, but I often use this community to find solutions. Today I have an issue which I didn't find any solution. Or maybe I asked wrong questions.

THE FLOW:

I have a flow which creates a task in the planner each time user add a new item to the SP list. I'm using required fields in SP LIST like "NAME", and this name is my TASK NAME. Another flow updates the Planner Task description with another field from the same SP LIST.

- I have 5 fields in SP LIST. NAME; DATE; USER; COMMENTS; LINK TO.
- NAME; DATE; USER are required
- COMMENTS; LINK are not required
- Field NAME copy as TASK NAME
- Fields DATE; USER; COMMENTS; LINK TO copy description field of Planer Task

So when user fill-in all fields in SP FORM, everything works fine and TASK in the Planner is creating with all data which I need.

ISSUE / PROBLEM
User fill-in only required fields, and non-required left empty the task is created, but the description field in Planner task stays empty, even if user fill-in required fields which have to copy to the description. So it works like all or nothing.

QUESTION:
How to write an expression in the flow which will be checking the value of the fields. Like: if filed contain value add it to the description if the filed is empty add value "empty."

Thanks in Advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: How to write an expression for adding an item from SP List into the Planner description if the item field in SP List is not required?

 

Hi @Pszyman ,

 

Could you provide the full screenshot of the flow configuration so that we could provide a proper workaround for you?

 

You could consider using the array/string variable to process multi people field.

The output of Join action is the display name of all people.

Image reference:

Spoiler
153.PNG

 

Best Regards,

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

View solution in original post

4 REPLIES 4
Highlighted
Super User II
Super User II

Re: How to write an expression for adding an item from SP List into the Planner description if the item field in SP List is not required?

@Pszyman 

Hi there.  Check out the function, Coalesce()  - It will let you put a dynamic value, or a series of values, and it will cycle through them until it finds a non-null value.  A good trick is to put your "empty" as the last choice, so if it doesn't find anything it will just put that.

 

It might looks something like this:

 

coalesce(<dynamic value>,'empty')  

 

Keep us posted.

-Ed

 

 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

Highlighted
Frequent Visitor

Re: How to write an expression for adding an item from SP List into the Planner description if the item field in SP List is not required?

Hi @edgonzales

 

Thanks for your first thoughts. I discover that my Issue is not about adding the value "empty" is about my fields Name. It is multi people field from SP list. I use that type of filed two times. And each time I use the Pople field in from SP list the FLow creating the additional loop "Apply to each". And when I have two Loop "Apply to each" and the user will not fill-in the non-required value than the flow not work at all.

So maybe I should ask how to change the values from the SP People field to text and show only Name or email?

Highlighted
Super User II
Super User II

Re: How to write an expression for adding an item from SP List into the Planner description if the item field in SP List is not required?

@Pszyman 

Ok, so ya...I would suggest treating that as two separate things:

  • The multiple people field creating an Apply to Each loop
  • Null values causing an error on non-required fields

 

The Apply to Each loop is happening because Power Automate is expecting an Array, or a series rather than a single bit of information.  Depending on how you're handling that information in your flow, you can grab a single element of that array using first() or split() etc..., or use join() to bring all of the array elements into a single string.

 

The coalesce() bit should work on the null values, but you can also check out other ways to manage that such as error-handling, or adjusting the schema to allow null values.  I'm not super great with the latter, so I'd go with coalesce() if facing the same issue.

 

Keep us posted.

-Ed

 

 

Highlighted
Community Support
Community Support

Re: How to write an expression for adding an item from SP List into the Planner description if the item field in SP List is not required?

 

Hi @Pszyman ,

 

Could you provide the full screenshot of the flow configuration so that we could provide a proper workaround for you?

 

You could consider using the array/string variable to process multi people field.

The output of Join action is the display name of all people.

Image reference:

Spoiler
153.PNG

 

Best Regards,

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

View solution in original post

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (5,860)