1

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

enter image description here This is how page with data looks like

This is the blank page (Page Number 4) without any data

user3482527
  • 227
  • 1
  • 2
  • 22
  • Hi, may I know if the solution I provided helps your problem ? If it helps, could you please mark my answer as "accepted", thanks~ – Hury Shen Feb 18 '20 at 01:02
  • Sorry buddy @HuryShen , i tried another solution and it worked. But your suggested solutions looks fine too. Many thanks – user3482527 Feb 18 '20 at 14:27
  • Hi, since my solution is ok and there aren't any other solutions under this post, you should accept it as answer. This can be beneficial to other community members. I vote up for your question, you accept my answer, ok? – Hury Shen Feb 19 '20 at 02:08

1 Answers1

2

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. enter image description here

The whole expression of "length()" method above is: enter image description here

Below provide the code for you to copy.

length(body('Parse_JSON')?['data'])

Hope it helps~

Hury Shen
  • 14,948
  • 1
  • 9
  • 18