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

SQL Connector working but not populating the email address to the people picker in Sharepoint Online

I have my SQL Connector connected to populate a SharePoint online list.  Same columns live in both SQL and Sharepoint.  All of the other columns populate except the email address.

 

I have tried several times and it just wont fill the field.  Any suggestions.

 

I am trying to keep the SQL DB which is the record of truth synced with SharePoint so when a change is done in SQL it automatically updates SharePoint,  I havent quite figured out how to do that piece, but the one I am using is triggered when a new item is added to SharePoint, it works but not the process I want to have it initiate.  I was using this flow to prepopulate the data the first time.  That is how I discovered that my emails are not populating.2019-06-27_7-17-46.png2019-06-27_7-18-28.png

 

 

2 REPLIES 2
Community Support Team
Community Support Team

Re: SQL Connector working but not populating the email address to the people picker in Sharepoint Online

Hi @Ruenells ,

 

From your description, it looks like you want to update SharePoint list when a change is done in SQL table.

 

However, if you are using SQL On-premises, it is not possible to trigger the flow when a change is made on a SQL table.

 

Please check the following doc:

https://docs.microsoft.com/en-us/connectors/sql/

 

Besides, about the Email Address field, is it a multiple selections enabled person or group column?

 

I assume that there would be multiple email addresses filed in the Email field in SQL table. what’s the format? Will it be something like “test1@contoso.com;test2@contoso.com

 

If so, please check if the following workaround will be a reference for you.

 

Manually trigger the flow.

 

Initialize 4 string variables, separately named as Test1, Test2, Test3, Test4.

 

Get rows from the SQL table.

 

Add an Apply to each to get email addresses from the SQL table.

 

Here image that there are at most 3 email address in each row, and they are in the format “test1@contoso.com;test2@contoso.com”.

 

Within the apply to each3, add the following actions:

 

Compose with function:

split(items('Apply_to_each_3')?['Email'],';')

 

Set variable1:

first(outputs('Compose'))

 

Set variable2:

first(skip(outputs('Compose'),1))

 

Set variable3:

first(skip(outputs('Compose'),2))

 

Set variable4:

 

if(

and(not(empty(variables('Test3'))),not(empty(variables('Test2')))),concat(variables('Test1'),';',variables('Test2'),';',variables('Test3')),

if(and(empty(variables('Test3')),not(empty(variables('Test2')))),concat(variables('Test1'),';',variables('Test2')),variables('Test1')))

 

Note: this function will return the correct email addresses which will be used in the following actions based on situations. If you have more email address, just try to modify the function.

 

Under Apply to each3, add Get items from SharePoint list, which contains a multiple selections enabled column.

 

Add Condition to check if name from SQL table equals to Title from SharePoint list. Apply to each and Apply to each2 will be added automatically.

 

Under If yes branch, update item with required value, select dynamic content variable4 for the MulPerson Claims field.

1.PNG2.PNG3.PNG

 

 

Best regards,

Mabel

 

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

Re: SQL Connector working but not populating the email address to the people picker in Sharepoint Online

@v-yamao-msft 

 

Here is an example of the current query I am runny and the output it provides, there will never be a multi select email field it is specific to the individual person. The query results are around 1650 lines.

I will see if your solution might work.  I have no problem manually starting the flow just need to be sure that it will amend to the existing fields and add any new ones that may be added.

The unique identifer is the Position Name not the email field as we may have open positions with no email so that is why that is being used.

 

SELECT [personName]
,[Email]
,[Email]
,[Code1]
,[employeeID]
,[positionName]
,[channelName]
,[zoneName]
,[regionName]
,[ModalityName]
,[positionTypeName]
,[mgrpersonName]
,[mgrEmail]
,[mgrEmail]
,[PlanNumber]
,[CARes]
,[mgrLastNameFirstName]

FROM quota.[dbo].[vwPersonPositionTemplate]
where CurrentMonthFLG = 'Y'

 

personNameEmailEmailCode1employeeIDpositionNamechannelNamezoneNameregionNameModalityNamepositionTypeNamemgrpersonNamemgrEmailmgrEmailPlanNumberCARes
Dorinda Reyesdorinda.reyes@abc.comdorinda.reyes@abc.combrc06990 PresidentLeadershipWestCaliforniaABCPresidentJohn Smithjohn.smith@abc.comjohn.smith@abc.com123No

Helpful resources

Announcements
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

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 Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,413)