cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
The_blue
Helper III
Helper III

How can i write nothing or skip writing if empty?

If a cell the flow is pulling from (excel file) is empty i want the SP list to have a blank entry but it won't allow it...

 

I tried this: 

if(empty(items('Apply_to_each')?['Expiry date']),'',addDays('1899-12-30',int(items('Apply_to_each')?['Expiry date']),'yyyy-MM-dd'))

(Green bit works fine for filled cells, red is my issue..)

 

And got this:

The runtime value '""' to be converted doesn't have the expected format 'String/date'.

 

Any ideas how to write nothing or just skip? 

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User
Super User

Hi @The_blue,

 

Can you try and use null instead of ''?

 

if(empty(items('Apply_to_each')?['Expiry date']),null,addDays('1899-12-30',int(items('Apply_to_each')?['Expiry date']),'yyyy-MM-dd'))

View solution in original post

2 REPLIES 2
Expiscornovus
Super User
Super User

Hi @The_blue,

 

Can you try and use null instead of ''?

 

if(empty(items('Apply_to_each')?['Expiry date']),null,addDays('1899-12-30',int(items('Apply_to_each')?['Expiry date']),'yyyy-MM-dd'))
v-LilyW-msft
Community Support
Community Support

Hi @The_blue 

Please take a try with @Expiscornovus 's solution, it is works and could solve your problem.

If your problem has been solved by @Expiscornovus 's solution, please go ahead and mark the post as solved by clicking “Accept as Solution” so that this thread will be marked for other users to easily identify!

In addition, if your 'Expiry date' column is Date data type , you can simplify your formula by the following way.

Select ISO 8601 for DateTime Format field in List rows present in a table action.

vLilyWmsft_0-1638325976707.png

Then you don’t need to use addDays and int function to format the date in excel.

The formula can be changed to:

if(empty(items('Apply_to_each')?['Expiry date']),null,items('Apply_to_each')?['Expiry date'])

vLilyWmsft_1-1638326153483.png

Best Regards.

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022- Season 2 has kicked off!

Users online (4,210)