We have many times faced this scenario; of updating a lookup field from a text field. I will be showing you how to do this without writing a single line of code, with the help of MS Flows.
Scenario: I have a custom entity ‘geography’ where I am storing all my post codes. This custom entity is also related to users/Salesperson. On my contact form there’s a reference field of Geography (Lookup) and Text field is Address 1: ZIP/Post Code. Now based on what is filled in the text post code field, I want to auto-populate geography so that I can further use it for salesperson assignment.
Let’s see how we can achieve this:
Step 1: Log on to flows.microsoft.com
Step 2: Click ‘My Flows’
Step 3: Click new and create from blank
Step 4: Select a trigger for your flow to execute
Step 5: Select the instance/Org of CRM and specify the entity
Step 6: Click on new step and select ‘condition’
I have entered a condition as ‘if Address 1 ZIP/Post code contains data’
Step 7: After you have entered condition, automatically a Yes and No branch will pop up. Under the Yes branch select what would you like to find. Basically asking flow to look at the list of geographies (custom entity for post code) to find if the Address 1: ZIP/Post code entered is found in the list. That’s why I have selected list records
Step 8: Specify the instance, entity and ODATA query. In my case the query is “name of the geography is equal to Address1:ZIP/Post code”. I know it sounds like a code but its not. You just have to know schema name of the field of the records you want to list. e.g. name eq ‘Address1:ZIP/Post Code’
Note that eq means equal. And I am using Address 1:ZIP/Post code as a dynamic expression and not query.
Now click on update a record
Step 10: Again select the instance, entity name and unique identifier of record. In my case ‘contact’
Step 11: The end result should be as shown below. Now click save and test your flow.
This is absolutely amazing coz we don’t need code to do that anymore now.
Hope this helps.
9 thoughts on “Update a lookup from a text field (No code solution)”
Hello! Thank you for the post; I have been trying to replicate what you’ve done here, but I’m running into trouble at the very end. I am trying to use Address 1: ZIP/Postal Code to update a lookup for ZIP Code on my account record. What dynamic field do you enter for the lookup? Also, I have two fields for the ZIP Code lookup field.
Which step Sarah? Can you please specify, so i can guide you better…thanks!
I am working on 2 entities. 1st is Contact (Renamed as Donor) and 2nd is Orders (Renamed as Donation).
On Donation entity form, I have a system mandatory look up field called “Potential Customer” and text field “Email Address”. I want to populate Potential Customer field value based on Email Address set. This operation will look for email address from contact entity and return the customer name to Potential Customer Field.
I have followed above steps but seems to something missing. I would like to send you snapshots but I can’t seem to find option here. Please let me know how to send you snaps. Thanks in advance.
Please send it on LinkedIn messenger.
Thanks for sharing the post!
I’m trying to follow above steps but it doesn’t work. I’m working on 02 entities: Events – custom entity and marketing list. In Event entity, I want to populate Marketing list Field (look up field to Marketing list entity) based on the name of Event (Text field)
Could you help me on this?
I would suggest using a unique number field for your marketing list so that there’s no duplication and the flow can identify it.