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

Update a Row in Excel Table but not when form response is blank

I am trying to write a flow that takes the responses from a form and either adds a row or edits a row in an excel table, the issue I am having is that when I want to edit a row, if any fields are left blank on the form then the corresponding cell in the already existing row in excel is deleted, how can I update a row but only take the form fields that are filled in and not the ones that are left blank?

 

adam0s_0-1653073066402.png

 

1 ACCEPTED SOLUTION

Accepted Solutions

Solved my issue with your suggestion, the problem lies in the difference between a blank vs empty(null) response, so using your suggestion above I had to take it one step further.

 

Instead of:


Coalesce(<<dynamic field from form>>, <<dynamic field from get row details>>)

 

You need to add in the logic that tells PA that a blank response is in fact a null response:

 

Coalesce(if(empty(<<dynamic field from form>>), null, <<dynamic field from form>>), <<dynamic field from get row details>>)

 

Thanks again for getting me started on the right path.

View solution in original post

3 REPLIES 3

@adam0s 

Check out the function Coalesce()

 

If you add a step to get the row in question first, then have your update step, you can do the following:

 

For each field in your update step, have an expression that looks like Coalesce(<<dynamic field from form>>, <<dynamic field from get row details>>)

That way, if the first one is null, it will use the data from the get row step...and if that one is blank, then no-harm-no-foul, ya?

 

Hope that helps, 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.

Thank you @edgonzales for your response, this looks like exactly what I need. I am having some trouble implementing it though, when I create the coalesce expression with the form response first then the field from the get row, if the form response is blank it is still wiping out the data from the row, the only thing I can think of is it is somehow not recognizing the blank response as null. If I reverse the order and have the row first then the form response, then no matter what I put into the form the data in the row will remain the same (as it should when the row is first) If the row is blank and I enter data into that field on the form it will stay blank, so it appears that no matter what it is taking the first response even if it is blank.

Solved my issue with your suggestion, the problem lies in the difference between a blank vs empty(null) response, so using your suggestion above I had to take it one step further.

 

Instead of:


Coalesce(<<dynamic field from form>>, <<dynamic field from get row details>>)

 

You need to add in the logic that tells PA that a blank response is in fact a null response:

 

Coalesce(if(empty(<<dynamic field from form>>), null, <<dynamic field from form>>), <<dynamic field from get row details>>)

 

Thanks again for getting me started on the right path.

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.

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.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (3,724)