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

PowerApps connection update item

Hi  🙂

 

I have 2 lists where one is used as a look up.

 

Please see pic 1, Within PowerApps, if an email is entered into 'ID Name', powerapps check list 2 to see if that email exists in list 2, if Yes then populate the City field in List 1 with the value in list 2.

 

Example

XYZ@mail.com is ID Name in list 1, in list 2 you have XYZ@mail.com and column 2 City = UK. 

 

If I manually enter an email into 'ID Name' it works fine and city is updated to e.g. UK

 

What I wanted to do is: (Pic 2)

  • Use when an email arrives in a shared mailbox trigger
  • If yes, create an item in list 1. For 'ID Name' field, use the 'From' email address
  • If  successful, City field would autopopulate due to the formula in Powerapps

 

Unfortunately the City field still remains blank. Does this make sense? Easy to fix or any other recommendations?

 

image.pngPowerapps formimage.pngMS Flowimage.png

Thank you.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: PowerApps connection update item

 

 

Hello @jay312 ,

 

The issue with using Lookup fields in the list is that there is referential constraint associated with it.

You cannot have other emails in List01 without it being present in List02.

If you can convert that column to be regular text field instead of a lookup. You can still have a separate flow for auto-populating the city field in List01 based on List02's city value.

Please consider having a another flow which looks like this:CommunityFlow.PNG

View solution in original post

17 REPLIES 17
Community Support Team
Community Support Team

Re: PowerApps connection update item

 

@jay312 ,

If you have a lookup column in SP list. If you go to list settings and open the column details.

You should see an option to display the auto-populated field there.

PAC1.PNGPAC2.PNGPAC3.PNG

 

 

Can you consider using such auto-populate field that already comes with the SP list?

jay312
Level: Powered On

Re: PowerApps connection update item

Hi @vikulkar 

 

I did not consider the look up option within SPO..

 

Do you know if that will accomplish the same goal? i.e if xyz@mail. com exists in List 2, then use the specific city value for email xyz@mail.com. If zzz@mail.com exists in list 2, then use the different city value for zzz@mail.com? 

 

Is it easy to set this up? 

Community Support Team
Community Support Team

Re: PowerApps connection update item

 

 

Hi @jay312 ,

 

Yes it should work, make sure you provide the id value of xyz@mail.com/zzz@mail.com in your flow

based on the id, the city field will be auto-populated.

jay312
Level: Powered On

Re: PowerApps connection update item

Hi @vikulkar 

 

Thank you for reply.. please is there any chance of some quick pics of the flow and or SPO look up list?

 

i.e. 

  • How would I set up my look up column? 
    • I would like to look up the email address in list 1, on list 2. If it exists in List 2 then autopopulate the 'City' field in List 1 with the value in List 2
      • What should I pick for 'In this column' ? and Do I just select City? I only want to pull the City field from list 2

 

Is a flow even needed if this happens? Is the basic flow to just create an item on a SPO list? P.S My flow trigger will be when an email arrives in a shared mailbox, create an item on a SPO list and fill in ID Name with 'From' email from sender and then City field should autopopulate if its look up..?

 

Thank you very much - see pic below

image.png

Community Support Team
Community Support Team

Re: PowerApps connection update item

Hello @jay312 ,

In my example List 01 has a email column which is a lookup that refers to List 02 which has the city value.

The city field in List 01 gets auto-populated when in PowerApps(connected to List01), the email field is filled as the screenshot shared below. there should be no necessary for a flow here.

List01.PNG

 

List02.PNGLookupPAFc.PNGPA1.PNGPA2.PNG

jay312
Level: Powered On

Re: PowerApps connection update item

Hello @vikulkar 

 

Thank you for reply 🙂 few qs please

 

  1. If i got rid of power apps all together and just use a default SPO list -> Still OK?
  2. I need a flow because the trigger will be 'When an email arrives in a shared mailbox, create an item on a SPO list'
    1. Using the 'From' person in the email, I will make a flow to 'Update item' and change the 'Email' column in SPO list to the 'From' sender from mailbox. 
      1. I would want the look up to see that Email is now autopopulated by flow, so should the City field automatically be looked up? This process works manually but I dont know if getting flow to autopopulate 'email' will trigger the City field to automatically look up. 

I will test this now to see but hopefully that makes sense.. 

 

 

jay312
Level: Powered On

Re: PowerApps connection update item

Hello @vikulkar  as an update.. maybe the pics below will help confirm if its possible or not

 

When microsoft flow creates a new item and fills in the ID Name with an email, I would want that if the email exists in List 2, then copy the City field for that email in list 2. List 1 is to store all records. List 2 is a database with 2 fields 'ID Name' and 'City'. 

 

I am unsure if getting flow to populate ID name will trigger City to automatically be populated too. 

 

image.pngimage.png

Community Support Team
Community Support Team

Re: PowerApps connection update item

 

 

@jay312 the below flow should help: 

since the column in List 01 is a look column. You will have to make sure you pass the id and not the email directly.

hence GetItems on List02 with a filter query should do the job.

If you pass the id, yes it should auto-populate the city field in list01

 

flow05.PNG

jay312
Level: Powered On

Re: PowerApps connection update item

hello @vikulkar 

 

Thank you! That seems to work great for part 1 of the flow.. For now I have recreated your lists with exact names etc to make it work

 

Please could assist on the next step I was hoping to add? Perhaps this is all one big look up so the below may be irrelevant/overcomplicated.. 

 

Now a new email arrives, and a new record is created in List 1, which has City field autopopulated using List 2 => All works fine

 

I now have a third list called 'List03' it would want columns with data:

  1. Column 1: Title (for now) => This is a list of emails. Its purpose is a data base of 'Trainers' 
  2. Column 2: City => This is a list of citys. E.g. trainer 1 = aaa@mail.com and city  = Moscow

 

I will add a new column to list01 called 'Assigned Trainer' 

  • When a record is created on list 01, e.g. abc@mail.com + City = Moscow. The assigned trainer field will be blank 
  • Now if the City field on list02 is equal to the city field in list03, so if moscow is on list02 and list03, then I want to get the Trainers email in list03 for that city and populate the 'Assigned Trainer' in list 01 

Very similar to what we done at start. Does this make sense / seem possible? I will write it in steps below to summarise

Scenario

  1. New email comes to xxzxz@mail.com from abc@mail.com
  2. Check if abc@mail.com exists on list02, if yes fill in the 'email' field in list01 and the 'City' field from list02 for that email
  3. Now if 'City' field in list01 exists for a Trainer in list03, then get that Trainers email and populate 'Assigned Trainer' field in list01.

Steps 1 and 2 look to have been done please do you have thoughts on step 3? a pic below if it helps EDIT PIC BELOW SHOULD SAY MOSCOW NOT USA. so if moscow is in list 3, take that assigned trainers email and put in list01

 

image.png

 

jay312
Level: Powered On

Re: PowerApps connection update item

hello again @vikulkar 

 

I tried a random solution but no luck. 

 

After we create item in list 1. I added get items from list 3 (to get the trainer email) and get items from list 1.

 

Then a condition that said if Email:city value value (from list 1) = City value in list 3.

 

If yes update the list 1 item Assigned Trainer with the Title (Email value) in list03. This gave a no  dependent actions succeeded error and the action update item failed. 

 

Anymore thoughts? see pics pls

 

image.pngimage.png

Community Support Team
Community Support Team

Re: PowerApps connection update item

 

@jay312 :

Assuming that you are looking on how to implement the 3rd part.

One way to achieve this is by setting the flow like this:

Before creating an item in List 01. I would getItem from list 3 by filtering based on the city in List 2 (which is same as the auto-populated one). after I get that I will create the item for List 01 by setting the 'Assigned Trainee' field

 

PAC4.PNG

 

jay312
Level: Powered On

Re: PowerApps connection update item

Hello @vikulkar 

 

Thank you that seems to work perfectly! The city field + trainer all autopopulate as expected.

 

Is there any chance you could advise on the last improvement?

 

I wanted some way to check if an email does not exist in list02 (the lets say database with email + city) then send an email to xxx to inform them.

 

Problems I ran into:

  • If I have abc@mail.com send an email but delete the record abc@mail.com + City = Moscow from List02, the flow will run but stop after step 2 (Get items but filter the Title = 'From' (sender from outlook)
  • This means:
    1. no record is created in list 1 so there is no real way to track if someone sent an email but they dont exist in list 2

Is there any way to have flow still create the item in list01 but leave the  City field blank? Could I add a condition after get items that says if 'From' is not equal to 'Title' in list 2, then send an email to xxx, if no then do rest of flow?

 

I wanted some method to track if the persons email is not in list 2, if no then create the item still on list01, (leave city field blank) and send an email to xxx. Then xxx will manually add the record to list 02..

 

Do you have any idea of creating this 'checker', could I add some condition after/before get items at start?

 

Some pics to recap flow but everything is same as you sent. 

 

image.pngimage.png

Community Support Team
Community Support Team

Re: PowerApps connection update item

 

 

Hello @jay312 ,

 

The issue with using Lookup fields in the list is that there is referential constraint associated with it.

You cannot have other emails in List01 without it being present in List02.

If you can convert that column to be regular text field instead of a lookup. You can still have a separate flow for auto-populating the city field in List01 based on List02's city value.

Please consider having a another flow which looks like this:CommunityFlow.PNG

View solution in original post

jay312
Level: Powered On

Re: PowerApps connection update item

Hi @vikulkar 

 

Thank you!  And if I wanted to add in the update 'Trainer' field in list 1, I just need to repeat these same steps but replace/ using the appropriate fields? e.g. SO get items from list 3, if 'trainer assigned' field is not null, update item etc?

 

I have made a new column in list 1 called 'email L1' and given it single line of text => Are there any benefits/concerns if I changed it to people/group instead? just curious not sure what is best. 

 

I have also made a new column called 'City L1' for list 1 as previously lookup brought it.. 

 

I added the city part in your pic and that worked fine. I added step 2 which is if City value = City value in List 3, then populate 'Assigned Trainer' in List 1 with the value in List 3. When I tested it the flow failed on the last part saying bad request.. Not sure if its because I renamed something but please see pics?

 

image.pngimage.pngimage.pngimage.png

 

 

jay312
Level: Powered On

Re: PowerApps connection update item

Hello @vikulkar .

 

The column name was the issue!! I just changed it in flow from City L3 to just 'City' and the flow ran fine.. ! Thank you

 

I am just trying a few other steps and will keep updated. And will try other test cases.. Thank you 🙂

Community Support Team
Community Support Team

Re: PowerApps connection update item

 

Hello @jay312 -

 

Glad to know that the flow is fixed!

If you just have a quick question related to this, use this thread but for any new separate issue please start a new thread.- as this will help our PAF community with readability. 

 

 

jay312
Level: Powered On

Re: PowerApps connection update item

ignore deleted

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons in April

Read the announcement for more information!

firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

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!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,791)