cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ruenells
Helper II
Helper II

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
v-yamao-msft
Community Support
Community Support

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.

@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
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (3,023)