Azure Logic App API Pagination using Until condition - azure

Wondering if you could help with this problem please. I am ingesting data from an API using Azure logic App. I have managed to set up everything else but struggling with pagination in Until condition.Logic App continues to ingest/consume data and creates blank json files with data[]. I have added the screenshots (with and without data in the page). When data is completed, empty or blank page looks like data[].
Any idea what could be my condition in "Until" ?
enter image description here

In your question I can't see the "Until" condition but just a "If" condition, but I think you just want to know how to check if the "data" field is empty and then do different actions (If I misunderstand your requirements, please provide more details and I will try to help you on it).
Please refer to the steps below:
1. We need to use a "Parse JSON" action to parse your json data, when click "Use sample payload to generate schema", you can put the json data which "data" field is not empty into it. And then it will generate the schema automatically.
2. Then we can use "length()" method in the "If" condition.
The whole expression of "length()" method above is:
Below provide the code for you to copy.
length(body('Parse_JSON')?['data'])
Hope it helps~

Related

PowerApps Flow: Action Failed on Condition

I am getting this error message:
InvalidTemplate. Unable to process template language expressions for action 'Condition' at line '1' and column '3364': 'The template language expression 'body('Get_item')['EmployeeLoginID']' cannot be evaluated because property 'EmployeeLoginID' doesn't exist, available properties are 'value'. Please see https://aka.ms/logicexpressions for usage details.'.
this has happened after I added several conditions to my "Apply to each" .
My current flow:
The two conditions here are "Employee_PrimaryLoginID" and "EmployeeID"
This is particularly strange as I didnt have this error before, then after appending so more conditions beneath this condition I am getting this error.
Any help would be appreciated.
This problem happens sometimes when you introduce new connectors to a flow after you have initially saved the flow without using that connector.
You can choose the following solutions:
1.Recreating new flow from scratch solve the issue.
2.Go to the Power Automate, export your flow. Then, Import your flow ( as a new flow).
Reference:
Unable to process template language expressions in Custom Connector
The issue sometimes occurres when the field value is null on CRM. Because of that the Dataverse connector didn't return the field name in the output so when trying to get the value of the field it returned the above error.
An alternative solution for this issue is to check if the field exists before getting its value, like this :
if (contains(body('Get_item'),'EmployeeLoginID') , body('Get_item')['EmployeeLoginID'],'')

Error when trying to find records from SharePoint in PowerApps

I am mostly new to PowerApps but I am creating a stand-alone app that uses Power Automate to upload records to a SharePoint library. I have that working, and on one of the forms I have search functionality so that the gallery is filtered by the value in a few text boxes.
What I want to do is on the form where they upload new records, I want to look up to see if metadata already exists and eventually populate text boxes with the information from those records. Right now I am using a button with this code in the OnSelect event to just find how many records exist with that project number:
Set(varCount, CountRows(Filter(ProjectDocuments,'txtProj#'.Text, ProjNum )))
I also tried this.
If(CountRows(Filter(ProjectDocuments,'txtProj#'.Text, ProjNum )) > 0, Set(varCount, 1), Set(varCount,2))
I am getting a warning about large datasets only. However, when I try to run it nothing happens. When I look at the monitor details I get this error first:
"The query is not valid.\r\nclientRequestId: 816f2bfb-ab50-4285-b9c9-a7e03548d15f\r\nserviceRequestId: 816f2bfb-ab50-4285-b9c9-a7e03548d15f"
Then this one:
"Error when trying to retrieve data from the network"
The connection works when I am filtering a gallery, but not when I'm trying to use the count. Does anyone have any idea what is happening?
Thanks!
I'm not sure, but I suspect that there's an error in your Filter. The second argument should result in a logical true/false (include the record or not). Yours looks to resolve to a string.
Filter(ProjectDocuments,'txtProj#'.Text, ProjNum )
I think you mean
Filter(ProjectDocuments,'txtProj#'.Text = ProjNum )

ModifiedBy field in SharePoint Document library is always my name instead of the one who triggered the flow

I have a flow, that gets triggered when a file is created in the Documents. The flow will add a column to the document library. The problem is that the modified by field in the Document library always contains the value as my name, instead of showing the user who triggered the flow.
I have already followed this article and seems like that is not working on my end.
After doing those changes, my flow runs fine without any error and giving an output as proceeding.
{
  "d": {
    "ValidateUpdateListItem": {
      "__metadata": {
        "type": "Collection(SP.ListItemFormUpdateValue)"
      },
      "results": [
        {
          "ErrorMessage": null,
          "FieldName": "Editor",
          "FieldValue": "[{\"Key\":\"i:0#.f|membership|nk#fdgfsgfs.de\"}]",
          "HasException": false,
          "ItemId": 1
        }
      ]
    }
  }
}
But there are no changes in the Document library, it still shows my name in the modified by column as I created the Flow. Even if this worked, I have another question that how can I dynamically find out and add who is triggering the Fow instead of giving a static editor claim in the first Compose step in the above image?
Anyone else faced this issue? Any help is really appreciated.
I do not think it is possible at the moment to dynamically find the current logged in user. you can check out this post
https://powerusers.microsoft.com/t5/Building-Flows/Flow-to-SharePoint-list-item-change-quot-Created-By-quot/td-p/93668
I could solve this issue by using the REST API in the flow itself. This is what I did,
Get the user who called the flow
Update the Modify field by using the REST API in the flow itself
This blog post will help.

Search for rows in Excel via Microsoft Graph API

I've built a scanner app that scans a barcode which acts as an ID. Now I need to find this item in a SharePoint Excel file using the Microsoft Graph API and perform actions with it.
Note:
The file, sheet, and table are all known beforehand.
For example, I want to retrieve row 5, with the only know parameter being Roll ID: B5
I've tried using filter methods, but they're not ideal for what I'm trying to build. I must be pushing this way over the limit as it's not a SQL database, but is there any way to get what I need?
As far as I understand the limit of microsoft-graph, the only way to perform where query is using the Filter. So far, the filter works for me.
start the session with persist = false, POST /createSession
clear filter, POST /tables/{table}/clearFilters
apply filter, -d "{ criteria: { filterOn: 'Custom', criterion: '=id' } }" POST /tables/{table}/column('{column}')/filter/apply
fetch visible row, GET /tables/{table}/range/visibleView/rows
close the session.
Hope this helps.

Passing form data to another form via url in lotus

I am working on a new web app in lotus/domino. I am newer to lotus/domino programming, so forgive me for not knowing something simple.
What I am trying to do is display a table of information, with one of the columns containing a link. The link is formatted like [http://server/app.nsf/form?openform&ideaNum=1&var2=foo2]
How can I retrieve the information from the url, to get information from a view or a document?
So far I have tried to access the query string in the webQueryOpen event, but lotus runs the agent before the DOM writes to the browser, the query_string isn't available.
I am not sure how else to get information from one form to another in lotus.
Thanks for the help.
-Kris
If you're passing multiple params in the query_string, you can get Domino to do a bit more of the work for you. There's an Function command - UrlQueryString - that can format the params into a list, delimiting at the "&".
E.g. server/app.nsf/form?openform&ideaNum=1&var2=foo2
becomes a list:
openform
ideaNum=1
var2=foo2
To use it, on the destination form create a multi-value text field called something like "QryStringList".
Set it to be computed when composed, and set it's value to #UrlQueryString.
In your WebQueryOpen agent, you can access the params as doc.QryStringList(0), docQryStringList(1) and so on, if you're using Lotusscript.
I'm fairly sure I put this together using info from the IBM/ldd forum, but the exact source is lost in the mists of time and memory, so apologies if I've copied someone's post.
Just as a follow up, I found that you are able to specify an on form variable named the same as QUERY_STRING. The variable is actually a reserved term for Lotus, so Lotus pre-fetches the variable before running the information out the browser.
Due to the pre-fetching, you are able to access the url information during the webQueryOpen event.
I hope this helps someone else looking for the same type of functionality.
-Kris

Resources