cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
akharns
Post Patron
Post Patron

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
Post Patron
Post Patron

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

DeepakS
Resident Rockstar
Resident Rockstar

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.

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.

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
Resident Rockstar
Resident Rockstar

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
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.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (5,397)