0

I tried to find documentation in the subject but fell short until now. I am trying to use Logic Apps in order to update a table when a trigger occurs.

Adding some context:

In many separate excel online file that are located in different area of Sharepoint, I have one Table in each of those files. Anytime the SQL table is updated, I get the following elements:

  • Name
  • Age
  • path_to_doc
  • doc_id

Name and Age are element I wish to add in those Excel file. path_to_doc is the path to the Excel file that needs to be updated. doc_id is the id of the Excel file that needs to be updated.

In the "Add row to a table" action, those are the elements that need to be filled:

  • Site (Manual no problem, this doesn't change) Document Library (Manual no problem, this doesn't change)
  • File (this is where I have a first problem: when I do not click manually, and try to put either the "path_to_doc" or the "doc_id" instead, it doesn't work.
  • Table (It seems that I can force it to be Table1), which is fine because all my Excel files have the table called Table1
  • Arguments (that is Azure understands the Table and is componnents and asks you to fill the ones you need to fill, those elements disappear when you change from a manual input to an input "path_to_doc" or "doc_id").

It throws me an error:
ERROR 400

enter image description here

NOTE: When I do it manually, it works.

Anyone has experienced this and found a solution? Thank you

RenauV
  • 363
  • 2
  • 11

2 Answers2

0

You don't need to use Expression.

For example, if we want to get tables of the modified Excel, we can do like this:

a screenshot about how to set the dynamics content

A similar flow in SharePoint: a screenshot about how to set the dynamics content in SharePoint

Allen Wu
  • 15,529
  • 1
  • 9
  • 20
  • Thank you but I am on Sharepoint, not on OneDrive. Is there the equivalent in Sharepoint? – RenauV Aug 15 '19 at 13:40
  • Yes. We can do it in SharePoint. The flow is basically the same. Have added the screenshot. – Allen Wu Aug 16 '19 at 01:39
  • But my file is not the one that is modified. Basically, I want to update file A when a file B is modified. That is why I intent to use more a dynamic path that brings the logic app to the file A because I do not know how to get the ID of this file since it is not the one that is being modified. – RenauV Aug 16 '19 at 15:54
  • I don't quite understand. You screenshot shows that when an item is created in SQL, add a row to the table. You want to get the file ID in step 2. So the ID needs to be put into the output of step 1. But I didn't see any information about it in step 1. So how does your app know which file you want to access? Can we get the names of file 1 and file 2 in step 1? Besides, the screenshot content does not seem to match "update file A when a file B is modified". Could you please provide more details? – Allen Wu Aug 19 '19 at 08:33
0

Finally found the answer. I needed to go to the code view and add my dynamic details there for the body. Thank you for your help.

Here is the solution. I hope it helps others :)

In the designer view, create an action "Add a row into a table" and use the dynamic path that brings you to the excel file that you need to update. It will show an error and you will not be able to add the body arguments.

enter image description here

In the code view, now you can manually add the body of the request to include the element you wish to update in the Table of the excel file.

enter image description here

That's it!

RenauV
  • 363
  • 2
  • 11