Announcements
No record found.
Hi,
I have a option set field which is being replaced with lookup field. Both the fields have same values. after removing option set and replacing with lookup, I need to update the lookup field data with option set values. How can i do it? if any one has existing code, could you please paste it below?
Hello Varma,
You don't need to build console app to perform that data migration.
You can do it via workflow (run using XRMToolBox Bulk Workflow Execution plugin) or Power Automate.
Hope this helps you.
Please mark the answer as verified if helpful. That will help others in future.
Hi Varma,
You can use power automate to create an automated flow to update lookup field, which maybe a simple way.
For example, i have one custom entity, which has one optionset field and one lookup field that related to 'optionset entity' entity, i need copy optionset field value to lookup field as your requirement.
1.Go Power Automate(https://us.flow.microsoft.com/en-us/ ) to create an instant flow.
2.Set trigger--'when a row is selected'
3.Action--'Get a row by ID'
4.Action--'Compose', get optionset field value label with following expression and you need replace logic name with your field.
outputs('Get_a_row_by_ID')?['body/new_optionsetfield@OData.Community.Display.V1.FormattedValue']
5.Action--'List Rows'
6.Action--'Initialize variable'.
7.Action--'Condition'
8.Branch for condition.
8.1. Under 'Yes'
8.2. Under 'No'
9.Test--Select records you want to update and expand flow to run the flow you just created.
Result:
Regards,
Leah Ju
Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.
Do we have Error handling in power automate flows and also can we see the failed records and success records?
You can check ‘Run history’ of the flow in power automate.
Hi Partner,
Has the problem been solved? Any updates?
Please click Yes under "Did this answer your question?" to close this thread.
Thanks.
Can anyone tell me how to do it in custom app? because i have some team limitations to do it in power apps.
Being a no-code guy, I would first keep both the optionset as well as the lookup fields on the form, create a view with both and then use 'Open in excel' to get the data in Excel, use copy/paste (from optionset to lookup column) and then save. Once re-import is complete then verify and then remove optionset field from the form/view.
As Gulshan said, you can use ‘Open in Excel Online’ function to achieve it if you can’t use power automate.
Prerequisites:
1.Create related records with same values from the optionset field.
2.Optionset field and related lookup field must in the same view.
Then you can export ‘Export to Excel’ to click ‘Open in Excel Online’.
Open one excel dialog.
Copy and paste value, save it.
Track Progress.
Waiting for the progress to 'Complete' status and navigate to entity view to refresh page;
I did everything in Microsoft flows. it is working perfectly. Now i need to handle failed records. if you see the below picture, out of 3 there are two failed records, now i want these two records which are from contact entity should be in log file where i can download it after the flow execution completed. How can i do it?
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Daniyal Khaleel 62 Most Valuable Professional
11manish 23 Super User 2026 Season 2
Travis South 10