cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
akharns
Level 8

Updating an Excel table row - generalized solution

Thanks to those who have moved me forward on this project before.  I'm ready to solve a next problem or two.

 

I am building a flow which will be called to update a row in an Excel table.  Input parameters will include the fields for row selection and fields in the table which will drive an action for each field to leave it as is, clear it, or assign the new value.

  • I have already built the logic to retrieve the row to be updated.  I am accessing the row in a For Each loop (which will only look at one row).  I am expecting to use the automatically generated "_PowerAppsId_" field as the unique key.  I have entered this as the Key Column.  Now I need to populate the Key Value.  In Dynamic Content, I can see Current Item, but I cannot see a way to reference fields within that item, such as "_PowerAppsId_".
  • For each field in the row, I need to specify a value.  Logic should be something like this:

If input value is "#", clear the field

else if input value is not blank, post the input value to the field

else leave the field value unchanged

How do I build logic like this in the Expression builder?

5 REPLIES 5
akharns
Level 8

Re: Updating an Excel table row - generalized solution

Clarification:  I am using "Apply to each", not "for each".

Highlighted
DeepakS
Level 10

Re: Updating an Excel table row - generalized solution

Hi @akharns  ,

 

I think the Power Apps Id column should two "_" vs. one, like '__PowerAppsId__'

I would also recommend using a custom ID column so you can control the value as you want to use this in the filter, instead of using auto-generate by Power Automate, again, this is my thought.

 

——————————————————
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

akharns
Level 8

Re: Updating an Excel table row - generalized solution

You're probably right about the powerapps id field spelling.  I was hoping to use an auto-generated ID.  My records require more than one column for specification.  I suppose I could create a concatenated column to use as a key.  I'll give that a try.  Maybe this would be easiest.  Still, I am left without a method of referencing the values in the Current record, if needed.

 

The 2nd question remains to be answered.

akharns
Level 8

Re: Updating an Excel table row - generalized solution

Regarding using the new concatenated key field, here is a sample expression intended to build the key value 

vSubmissionMonth = 2019-10

triggerBody Vendor = XYZ

Expected key value:  2019-10-XYZ

 

The following code is not yet correct:

key eq concat(variables('vSubmissionMonth'),"-",@{triggerBody()?['Vendor']})

DeepakS
Level 10

Re: Updating an Excel table row - generalized solution

Hi @akharns 

 

Yes following should work:  

 

concat(variables('vSubmissionMonth'),'-',triggerBody()?['Vendor'])

 

——————————————————
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

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!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,572)