Power Automate Exchange

Please login or click SIGN UP FOR FREE to create your FlowUG account to join this user group.
  • 1.  Working with Power Automate

    Posted Sep 21, 2021 05:09 PM

    Hello,

     

    Newbie to Power Automate.

     

    I am trying to create a email that will notify multiple city managers when a new record is created.  I have two SharePoint list that I am working with.  The first one contains all the information submitted for a request.  The second Sharepoint list is the city and the DL list on who needs to receive the email.

     

    My problem is I have a column in my first SharePoint list that has a concatenated value.  My dilemma is how to break that up so I can grab the appropriate email addresses from my second list.  Below are examples:

    Sharepoint List 1:                            Sharepoint List 2:

    SendingStation                  City                    EmailAddress

    City1, City2, City3              City1                  me@anywhere.com

                                                 City2                  you@someplace.com

                                                 City3                  them@thisplace.com

     

    End results is, I want to pull out City1 and filter that in Sharepoint list 2 and grab the email address then continue looping through until I have all the addresses for each city.  Recommendation?

     

    Thanks,

    DeAnn

     

     

    DeAnna Pitts

    Senior Technical Business Analyst

     



  • 2.  RE: Working with Power Automate

    Posted Sep 22, 2021 12:42 AM
    Edited by K S Sep 22, 2021 02:37 AM

    Use lookup List and its values for selecting the Cities

    Here you can use lookup List. Use your CityEmail list as lookup list in your Main List.
    That lookup List will help you in selecting the desired email address or multiple email adderss in one go to send email through automation.

    Multiple email ids for 1 city no problem. make sure the field type for email ids is text and email ids should be separated by ";" with no space in between any text.

    Hope it helps



    ------------------------------
    K S
    SharePoint Developer
    ------------------------------



  • 3.  RE: Working with Power Automate

    Posted Sep 22, 2021 09:40 AM
    Hi K S,
    Yes, I am using an automated flow and it will be triggered every time a new item is added to the Sharepoint list.

    ------------------------------
    DeAnna Pitts
    Senior Tecnical Business Analyst
    Phoenix AZ
    ------------------------------



  • 4.  RE: Working with Power Automate

    Top Contributor
    Posted Sep 22, 2021 01:04 AM
    First Initialize Variable. Set the type to array and call it emailAddresses.

    Now add a Compose. Use the expression split(triggerBody()?['SendingStation'],',') assuming the list with the SendingStation column is the same one the flow is triggered from.

    If in doubt, type split(,',') in the expression editor, place the cursor after the ( then click the dynamic content tab and find the relevant part by scrolling through and click OK.

    Now add an Apply to Each loop with the output of the Compose from earlier as its input. Inside the Apply to each put a Filter array action.

    The array to filter is the value property of the Get items action where you get List 2. The filter condition is:

    @equals(item()?['City'],trim(items('Apply_to_each'))) - Click Advanced, paste this in then you can click back to basic.

    Now, Put in a Condition. The condition is the expression length(body('Filter_array')) is greater than 0

    In the Yes branch, do Append to array variable. Select the array you initialised earlier and the value to append is the expression first(body('Filter_array'))?['EmailAddress']

    Now below the apply to each loop add an action called Join. The array is the variable and the character to join on in ;

    You can now use the output of the join as the To: input of an email. You might also want a condition before the email to ensure length(variables('emailAddresses)) is greater than 0 so the email action does not fail. ​

    ------------------------------
    Will Page
    Technical consultant
    Christchurch, NZ
    ------------------------------



  • 5.  RE: Working with Power Automate

    Posted Sep 22, 2021 09:33 AM
    Thanks Will.  I will certainly give this is a try and post my outcome.

    ------------------------------
    DeAnna Pitts
    Senior Tecnical Business Analyst
    Phoenix AZ
    ------------------------------



  • 6.  RE: Working with Power Automate

    Bronze Contributor
    Posted Sep 22, 2021 02:02 PM
    Take a look at the split()  function:

    SplitTextSeparator )

    This will give you the City column in your post.  What was not clear to me is where you match email to city.  If you have a list that has rows for city and a corresponding column for email address, then use Lookup() based on the returned-from-split() city values to get the email address.  Use a ForAll() to process all of the city values returned from split().

    Hope this helps and I fully understood your need.

    Techevents
    Everett, WA

    ------------------------------
    Larry Heimendinger
    larry@techevents.com
    RedmondWA
    ------------------------------



  • 7.  RE: Working with Power Automate

    Posted Sep 22, 2021 02:11 PM
    Hello Larry,
    Appreciate the feedback and you did understand my need.

    ------------------------------
    DeAnna Pitts
    Senior Tecnical Business Analyst
    Phoenix AZ
    ------------------------------



  • 8.  RE: Working with Power Automate

    Bronze Contributor
    Posted Sep 22, 2021 02:22 PM
    You are welcome.

    You might find some useful Power tips and suggestions in one of my blogs

    I Love Power Apps and Flow

    and I am available to work with your company as you may require.

    Glad to have helped.

    ------------------------------
    Larry Heimendinger
    larry@techevents.com
    EverettWA
    ------------------------------