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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 26.04.2019, 14:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,640 / 848 (80) +++++++
Регистрация: 28.10.2006
crmtipoftheday: Tip #1258: Dynamic attribute names in Flow
Источник: https://crmtipoftheday.com/1258/dyna...names-in-flow/
==============

You know who are the most relentless follow-uppers? Super Simple Flow users, that’s who.
Thank you everyone for your answers to my previous question. I have a follow up question. Is it possible to get the value of an attribute off of an entity dynamically instead of declaratively? E.g. instead of blah?[0]?.fullname something like blah?[0]?[someattributenameIgotinapreviousstep]

Michael “Super Simple Flow User” Ochs
Demo

Let’s consider a scenario where you need to build a full name of a contact while taking into account that some countries do not follow ‘firstname lastname’ convention. For example, to a Westerner, Chinese names are rather complicated. In a real-life implementation I would consider keeping fullname as a separate custom field, just to be on a safe side. But for the demo sake, let’s say we would like to follow ‘lastname firstname’ convention if contact’s account is located in China.

Side note: this Flow also demonstrates a scenario when variables do make sense.

The full flow may look like this:

Let’s break it down.
  • First step is given to us by On Record Selected trigger (on account entity)
  • Second step is getting the last created contact. See Tip #1256.
  • Next two steps simply declare the variables to hold the field names for the first and last names (as they come from CDS)
  • Shall we swap? is a cute name when we check the parent account’s country and swap the attribute names
  • Finally, we’re ready to build the full name. Expression we built in Tip #1257 just got a bit more complicated (I broke it down to separate lines for the readability):
concat( body('Get_Last_Contact')?['value']?[0] ?[variables('FirstName')], ' ', body('Get_Last_Contact')?['value']?[0] ?[variables('LastName')])
  • The last step is unchanged from Tip #1257 – we send ourself a mobile notification with the fullname we just built
The end result (after relocating Alpine Ski House to China):

Time for Doubinski George to take a small break from Flow.




Источник: https://crmtipoftheday.com/1258/dyna...names-in-flow/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
crmtipoftheday: Tip #1247: Why you should rename your steps in Flow Blog bot Dynamics CRM: Blogs 0 03.04.2019 17:11
crmtipoftheday: Tip #1243: Forgot to turn off the Flow Blog bot Dynamics CRM: Blogs 0 28.03.2019 14:11
crmtipoftheday: Tip #1205: Local time in Flow using Common Data Service Blog bot Dynamics CRM: Blogs 0 06.12.2018 18:11
crmtipoftheday: Tip #1124: Flow Approvals May Be Exactly What You Need Blog bot Dynamics CRM: Blogs 0 25.06.2018 12:11
crmtipoftheday: Tip #1094: It is Time to Go with the Flow Blog bot Dynamics CRM: Blogs 0 27.03.2018 09:11

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

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

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 20:01.