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.
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.
Best regards,
Mabel
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'
personName | Code1 | employeeID | positionName | channelName | zoneName | regionName | ModalityName | positionTypeName | mgrpersonName | mgrEmail | mgrEmail | PlanNumber | CARes | ||
Dorinda Reyes | dorinda.reyes@abc.com | dorinda.reyes@abc.com | brc06990 | President | Leadership | West | California | ABC | President | John Smith | john.smith@abc.com | john.smith@abc.com | 123 | No |
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Did you know that you could restore a deleted flow? Check out this helpful article.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.