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'))

View solution in original post

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
Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,842)