AXForum  
Вернуться   AXForum > Microsoft Dynamics CRM > Dynamics CRM: Blogs
CRM
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 10.12.2018, 23:12   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
powerobjects: And Operator in Flow
Источник: https://www.powerobjects.com/2018/12...operator-flow/
==============


We’ve devoted several blog posts in 2018 to Microsoft Flow because of its awesome ability to automate workflows quickly with a no-code/low-code approach. If you haven’t read our recent post on building Flows in mere minutes, please check it out – it’s worth your time!

Today’s post is devoted to Flow’s And operator, which enhances the automation potential of our workflows. In certain business scenarios, we want the action we take to be based on multiple checks – e.g., if condition A is true AND condition B is also true, then take subsequent action, otherwise take no action. To help illustrate this, let’s consider a real-world scenario.

Let’s say that we are operating a roofing company; one of our main tasks involves sending our technicians to inspect roofs for damage. As the technicians inspect the roof, they mark Yes or No to various questions in an inspection checklist on their mobile device. Next, let’s say that if, for example, they find water stains (condition A) AND they also find water leaks (condition B), we want to automatically send the customer an email suggesting that the best way to prevent potential future water-related problems is by installing smart sensors on their roof. Here’s how we can accomplish this with a Flow.

1. We will trigger our Flow when a record is created. In our case, we are creating an Inspection Check Lists record.



2. Next, we need a Condition. To create one, click New Step > Condition Control.



Now, in this case, we want to add two conditions. With Flow, multiple conditions are added in advanced mode in the form of a formula. Don’t be intimidated! Just because we’re going into advanced mode does not mean we’re doing anything especially technical or advanced – we’re simply tweaking the formula, which can only be done in this mode. The following steps provide an easy way to generate a formula for our And condition.

3. Let’s add the first condition: is our vr_waterleaks field equal to true? Here, we need some very simple code to define a true value: @equals(triggerBody()?[‘vr_waterleaks’], true).



4. As stated earlier, the way to hardcode multiple conditions is by clicking Edit in advanced mode. Once in advanced mode, copy the code from the previous condition (Step 3) without the “@”: @equals(triggerBody()?[‘vr_waterleaks’], true). You’ll need this in Step 7.

5. To add our second condition, we will go back to Edit in basic mode, clear the condition created in Step 3, and create the second condition: is our Water Staining field equal to true? Again, we need some very simple code: @equals(triggerBody()?[‘vr_waterstaining’], true).



6. Now we need to combine the two conditions. While still viewing the second condition, once again click on Edit in advanced mode. At the beginning of the code, add an And clause by typing “and(,” between “@” and “equals.” It should now look like the After column:

Before

After

@equals(triggerBody()?[‘vr_waterstaining’], true)@and(,equals(triggerBody()?[‘vr_waterstaining’], true)7. Next, paste the code for the first condition (copied in Step 4) between “and(” and “,equals.” It should now look like After column:

Before

After

@and(,equals(triggerBody()?[‘vr_waterstaining’], true)@and(equals(triggerBody()?[‘vr_waterleaks’], true),equals(triggerBody()?[‘vr_waterstaining’], true)8. Finally, add a close parenthesis – “)” – to the very end of the formula. It should now look like After column:

Before

After

@and(equals(triggerBody()?[‘vr_waterleaks’], true),equals(triggerBody()?[‘vr_waterstaining’], true)@and(equals(triggerBody()?[‘vr_waterleaks’], true),equals(triggerBody()?[‘vr_waterstaining’], true))9. Hit and you’re all done creating an And clause that will take an action you define if and only if both conditions are met.

Hopefully, you can think of many uses for this Flow operator in your own organization. To learn more about Flow, please visit our website. If you’re interested in taking a Flow class, we offer two different PowerApps and Flow courses: one focuses on Model Apps and one on Canvas Apps.

Happy Flow’ing!



Источник: https://www.powerobjects.com/2018/12...operator-flow/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 02:36.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.