cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Matt_Vie
Level: Powered On

do until

Hi everybody,

 

I am trying to set up a flow with a "do-until" loop.

The flow starts with a HTTPS-Get request, which gets replied.

I want do repeat the Request till "orderstate" in the body becomes "201"

Body:

[
  {
    "orderdate""14.03.2018",
    "orderid""NFH1803140758",
    "ordertext""Einsatz",
    "ordertype"1,
    "objectno""02",
    "objectname""NFH 1",
    "longitude"16416038,
    "latitude"48171998,
    "destination""Wien, Gasse 11",
    "orderstate"401,
    "orderstate_time""14.03.2018 08:37",
    "orderstate_longitude"16416051,
    "orderstate_latitude"48172299,
    "orderstate_postext""Wien, AT",
    "notify_enabled"false,
    "notify_leadtime"15,
    "orderstate_msgtext""Auftrag : erledigt",
    "driverno""02",
    "drivername""Matthias",
    "waypointcount"0,
    "objectuid""1-47",
    "country""AT",
    "city""Wien",
    "zip""1110",
    "street""Gasse 11",
    "driveruid""1C3",
  }
]

 

How do I have to put it in the "Do until" Loop.

At the moment I have @equals(body('HTTP')['orderstate'], 201) - which doesn´t work

 

Thx for your help

6 REPLIES 6
Super User
Super User

Re: do until

Why Don't you initilize a variable and then inside your loop set the varibale to the order state. Then in you do until condition you just need to add the condition depending on the variable.

Matt_Vie
Level: Powered On

Re: do until

What would that variable look like?

Super User
Super User

Re: do until

Please add an action called initialize variable near the top of your flow

 

then use a Set Variable  action to set the variable to the bit of data that you want using the Dynamic content

Matt_Vie
Level: Powered On

Re: do until

I followed your advice an got a variable with the data i wanted:

 

Output

Name
OST
Value
[
  "orderstate"
]
 
The "do-until is:
 
@equals(variables('OST'), 201)
 
But it still doesn´t work...
Community Support Team
Community Support Team

Re: do until

Hi @Matt_Vie,

 

Could you please share a screenshot of your flow's configuration?

Could you please show more details about the error message?

 

I have made a test on my side and don't have the issue that you mentioned. My flow's configuration as below:7.JPG

Within "Do Until" action, click "Edit in advanced mode", type the following formula:

@equals(body('HTTP')?['orderstate'], 201)

Click "Change limits", Count property set to empty (default value of it is 60).

 

The flow works successfully as below:8.JPG

 

 

When the value of "orderstate" key changes into 201, the flow works well as below:9.JPG

 

 

 

If you could provide more details about your scenario, we would provide a proper workaround for you.

 

Best regards,

Kris

 

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Matt_Vie
Level: Powered On

Re: do until

Hey Kris,

I created a new Flow following your instructions and get this error message:

 

InvalidTemplate. Vorlagensprachausdrücke für Aktion "Wiederholen_bis" in Zeile "1" und Spalte "878" können nicht verarbeitet werden: Der Vorlagensprachausdruck "equals(body('HTTP')?['orderstate'], 201)" kann nicht ausgewertet werden, weil die Eigenschaft "orderstate" nicht ausgewählt werden kann. Arrayelemente können nur mit einem Ganzzahlindex ausgewählt werden. Weitere Informationen zur Verwendung finden Sie unter https://aka.ms/logicexpressions..
 
The Flow looks like this:

 

Sorry, but I can´t attach pictures in this post and don´t know why...

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 185 members 5,313 guests
Please welcome our newest community members: