cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

How to join multiple if(empty()) statements in one field?

Hi fellow PA veterans,

 

 

Quick question, I am wondering if someone could correct my if expression below, I am trying to join three if(empty()) statements in the 'Start Date'? 

 

On the MS Form, I have three Dates, 'Start Date1', 'Start Date2' and 'Start Date3'

On the SharePoint list, I have just one column called 'Start Date', which I wish to use to capture any of the dates above.

 

I can get a single if(empty) statement to work without an issue:

if(empty(DynamicContent[StartDate1],null,DynamicContent[StartDate1])

 

But error when I attempted to join them:

if(empty(DynamicContent[StartDate1],null,DynamicContent[StartDate1]), if(empty(DynamicContent[StartDate2],null,DynamicContent[StartDate2]),

if(empty(DynamicContent[StartDate3],null,DynamicContent[StartDate3])

 

Power Automate > SharePoint Create Item

fields.jpg

 

Reasoning:

The reason I am using an if(empty()) statement in the field is to return 'null' whenever StartDate1, StartDate2 or StartDate3 is not filled out on the MS Form. They are mandatory branching questions and may not get filled out all the time. It would have caused an error in Power Automate if I don't have this if statement.

 

Thank you guys.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User III
Dual Super User III

Re: How to join multiple if(empty()) statements in one field?

Hi!

Yes you are right!

if(empty(DynamicContent[StartDate1]),if(empty(DynamicContent[StartDate2]),if(empty(DynamicContent[StartDate3]),null,DynamicContent[StartDate3]),DynamicContent[StartDate2]),DynamicContent[StartDate1])

In case it keeps on failing, can you share corrent expression you are typing?

Thanx!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

8 REPLIES 8
Highlighted
Resident Rockstar
Resident Rockstar

Re: How to join multiple if(empty()) statements in one field?

@Australia 

are you trying to get the start date in your if expression from an MS form?

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.
Highlighted
Dual Super User III
Dual Super User III

Re: How to join multiple if(empty()) statements in one field?

Hi!

Let me see I understood your goal:

If StartDate1 exists, StartDate1 should be the output.

If StartDate1 does not exist, but StartDate2 does, StartDate2 should be the output

If neither StartDate1 nor StartDate2 exist, but StartDate3 exists, StartDate3 should be the output

Else, return null

 

Is my assumption right? If so, I would try with the following:

 

 

if(empty(DynamicContent[StartDate1],if(empty(DynamicContent[StartDate2],if(empty(DynamicContent[StartDate3],null,DynamicContent[StartDate3]),DynamicContent[StartDate2]),DynamicContent[StartDate1])

 

 

So you need to nest your if()

Hope this helps

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Helper II
Helper II

Re: How to join multiple if(empty()) statements in one field?

Hi Mira,

 

Thanks for the prompt reply.

I have three Start Dates on my MS Form and have one column called 'Start Date' in my SharePoint list, which I wish to capture all three dates in this one field.

Highlighted
Resident Rockstar
Resident Rockstar

Re: How to join multiple if(empty()) statements in one field?

@Australia 

Please check the nested if condition supplied by @efialttes  this should work for you.

 

Good Luck

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.
Highlighted
Helper II
Helper II

Re: How to join multiple if(empty()) statements in one field?

Hi efialttes,

 

Thanks for the reply and your interpretation is correct! 

Sorry I should have explained myself better.  (facepalm)

Let me give it a try and will let you know shortly.

 

 

Highlighted
Helper II
Helper II

Re: How to join multiple if(empty()) statements in one field?

@efialttes 

It seems I am getting an error "The expression is invalid."

I am guessing the expression is missing some close brackets?

Highlighted
Dual Super User III
Dual Super User III

Re: How to join multiple if(empty()) statements in one field?

Hi!

Yes you are right!

if(empty(DynamicContent[StartDate1]),if(empty(DynamicContent[StartDate2]),if(empty(DynamicContent[StartDate3]),null,DynamicContent[StartDate3]),DynamicContent[StartDate2]),DynamicContent[StartDate1])

In case it keeps on failing, can you share corrent expression you are typing?

Thanx!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

Highlighted
Helper II
Helper II

Re: How to join multiple if(empty()) statements in one field?

@efialttes ,

You are a genius! It worked! You have made my day. 😄

I actually have another question: https://powerusers.microsoft.com/t5/Building-Flows/SharePoint-Get-file-using-path-How-to-add-multipl...

see if you can help, too. 🙂

 

Thanks again.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Users online (5,200)